Cary is a town in Wake and Chatham counties in the U.S. state of North Carolina and is part of the Raleigh–Cary, NC Metropolitan Statistical Area. According to the 2020 Census, its population was 174,721, making it the seventh largest municipality in North Carolina, and the 148th largest in the United States. In 2021, the town's population had increased to 176,987. Cary began as a railroad village and became known as an educational center in the late 19th and early 20th centuries. In April 1907, Cary High School became the first state-funded public high school in North Carolina. The creation of the nearby Research Triangle Park in 1959 resulted in Cary's population doubling in a few years, tripling in the 1970s, and doubling in both the 1980s and 1990s. Cary is now the location of numerous technology companies, including the world's largest privately held software company. In Cary, 68.4% of adults hold a bachelor's degree or higher, which is higher than the state average. In 2021, it was identified as the safest mid-sized city in the United States, based on 2019 FBI data. It also has a median household income of $107,463, higher than the county average of $83,567 or the state average of $56,642.