New York City has significantly fewer children and teenagers than it did before the coronavirus pandemic spurred an exodus of families to the suburbs and other states, according to an analysis of new census data released Thursday.

The number of New Yorkers under the age of 20 fell by 9 percent — or more than 186,000 people — to 1.8 million in 2023 from just three years earlier, according to Social Explorer, a data research company that analyzed the census estimates.

It was the biggest drop in at least a decade in the city’s under-20 population. The decrease could potentially affect the city’s education policies and public school system, which is the largest in the United States, and could eventually help shape the city’s work force and economy. That age group has been steadily shrinking in the city since at least 2010 even as older age groups have been growing.

Though the census estimates do not offer an explanation for the demographic changes, many families with children, including many Black families, have moved out of the city in recent years because of a shortage of affordable housing, a shift to work-from-home policies, concerns about school quality and crime and a desire for more parks and open spaces, among other reasons.

All five boroughs lost residents under the age of 20, with Brooklyn losing 66,000 younger residents; Queens losing 53,000; the Bronx 41,000; Manhattan 22,000; and Staten Island nearly 4,000.

The suburbs surrounding New York City also lost younger residents, but those drops were more modest. Long Island lost nearly 18,000 residents under age 20, while New Jersey suburbs lost nearly 40,000 younger residents.