For any parent, deciding where to put down roots is a complex calculation. Do you need to live near your family? What about the school system? How long of a commute to work can you stand? What can you afford for a housing payment?

This challenging balancing act can have huge consequences — academic research has found that moving to a new home during childhood can have a negative impact on kids’ school performance, behavior and social skills.

Finding a place in the sweet spot for your family is important, not just for your kids but for you, too. After all, in addition to creating emotional upheaval, moving is expensive. Staying in the same state will run you an average of $1,250 just in moving costs, which doesn’t take into account the cost of finding new housing, and an interstate move could run near $5,000.

So which U.S. cities provide the best setting in which to raise children?

We wanted to use data to figure out which cities are the best (and worst) for families, so we compared hundreds of cities across a range of metrics that cover things like housing affordability, access to parks, crime rates and other factors that go into making a community attractive for parents and children.

What we found was that among the cities that scored the best, there was a huge degree of geographic diversity, though the Midwest does dominate the top 10. Conversely, every city in the bottom 10 is located in either the South or the West.

Complete Ranking

To ensure an apples-to-apples comparison, we’ve winnowed our list to the 65 U.S. cities and metro areas for which data was available in every category we measured. You can jump to the bottom of the page for a full look at our methodology, but here’s a quick-and-dirty explanation for how to read the overall ranking: The lower a city’s numerical score, the more attractive that city is to raise a family.

A pair of upper-Midwestern cities that are only about a four-hour car ride apart take our No. 1 and No. 2 spots. Madison, the Wisconsin state capital, posted by far the best score in our analysis, with a total score of just 111, meaning the city of about 250,000 tends to rank among the best in the nation across the 10 metrics we considered. Minneapolis-St. Paul, Minnesota’s Twin Cities, took our second overall spot with a total score of 131, well behind Madison but well ahead of the tied cities of Washington, D.C. and Boston.

Every region of the country is represented in the top 10, with the Midwest accounting for both the top two and four of the top 10 overall. The West has three cities in the top 10, and the District of Columbia is the only Southern city among the 10 with the best scores.

The average score among all cities was 312, and a total of 27 cities had better scores than that. Among that group of states, Ohio boasts three and California and Wisconsin two each.

Tucson was the worst-performing state on our list, but Bakersfield, California was hot on Tucson’s heels, with just five points separating the two cities. California has four cities in the bottom 10, while Texas has two.

Breaking Them Down:

15 Best Cities

Let’s dig deeper and see why the 15 cities with the best scores placed where they did on our list by diving into the 10-category metrics for each of them:

Breaking Them Down:

15 Worst Cities

We’ve seen how the best cities performed; now let’s see why the states that ranked low performed the way they did:

Best & Worst by Category

In our analysis, we weighted each category at the same rate, but for some families, access to parks may be less important than crime rates, while other families may value certain areas more. So now let’s take a look at the best and worst cities in each of the categories we examined:

Conclusion

It takes a village to raise a child, as they say. For parents who have the freedom to choose where they put down roots, it’s pretty clear that some villages are better than others. What our analysis showed is that only a handful of cities perform well across the board, and depending on what’s most important to you, the differences could be huge. While it’s no guarantee of happiness or long-term success in life, starting your kids out on the right foot means living in a community that provides them with as many opportunities as possible.

About This Report

We touched on our methodology earlier, but here’s the full methodology and sourcing for each data point we used in calculating our ranking:

Methodology: In each category, we collected data for hundreds of major U.S. cities, and because not every city had data available in every category, we limited our scope only to cities where we could find data in every (or almost every) category. That left us with 65 major American cities, which were then ranked from best to worst (1-65) and each city’s ranking in each category was then added together to create the overall best-to-worst ranking. Cities with lower numbers have data that paints a better picture for families than cities with higher totals.

Crime rates: We calculated an average crime rate for each city/metro area using data published by the FBI. That covers rates of both violent crime and property crime.

Household income: We used U.S. Census Bureau data that lists the median annual household income by city and/or metro area.

Poverty rate: We used a Census Bureau table that details the percentage of families living below the poverty line in each city.

Proximity to parks: We used a figure on the percentage of people in each city living within a 10-minute walk to a park; this information was published by the Trust for Public Lands.

Rent: We used Zillow’s proprietary index that calculates median rental rates in each city.

Housing affordability: We calculated the percentage of monthly household income that goes to rent by dividing the median annual household income by 12 and dividing the median monthly rent figure by that amount.

High school completion: We used a Census Bureau table that lists the percentage of people in each city 25 and older who have a high school diploma or equivalency certificate.

Food hardship: We used data from the Food Research Action Center that estimates in each city the percentage of families with children who have experienced food hardship or scarcity, which is defined by a household inability to afford food. Data was unavailable for a few cities, and in those cases, state-level data was substituted.

Health insurance: We calculated the percentage of children with health insurance coverage based on a table published by the Census Bureau.

Unemployment rate: We used the most recently available unemployment rate for each city or metro area, published monthly by the U.S. Department of Labor.