Families seeking to buy a home are struggling with the rising home prices in today’s housing market.

Across 40 large cities in the U.S., about 55% were considered affordable and were large enough to house working-class families with their two to four bedrooms, according to a new study by Redfin, an online real estate brokerage.

However, this does not mean that all of those cities are great markets for a family.

In order to determine the most family-friendly places in America, WalletHub’s analysts compared the 150 most populated cities across 36 key metrics. The data set ranges from crime rates to school system rankings to housing costs.

Here are the best cities in the each of the study’s topics:

Playgrounds per 100,000 residents: Madison, Wisconsin with 72.96

Violent-crime rate: Irvine, California with 0.49

Median family annual income (adjusted for cost of living): Scottsdale, Arizona with $101,811

Divorce Rate: Fremont, California with 12.2%

Percentage of families receiving food stamps: Irvine, California with 2.99%

Percentage of families living below poverty line: Overland Park, Kansas with 3.9%

When combining all of these factors, here are the top five housing markets for families. The top score is 100, with 20 points available from each category: Family fun, which includes the number of playgrounds per 100,000 residents, health and safety, education and child care, affordability and socioeconomic environment. 

5. Virginia Beach, Virginia, which has a total score of 68.82. It ranked 83rd in family fun, third in health and safety, 19th in education and child care, 13th in affordability and 14th in socioeconomic environment.

Virginia Beach

4. Sioux Falls, South Dakota, which has a total score of 69.36. It ranked 61st in family fun, 29th in health and safety, 33rd in education and child care, sixth in affordability and eighth in socioeconomic environment. 


3. Plano, Texas, which has a total score of 72.59. It ranked 86th in family fun, fourth in health and safety, 51st in education and child care, first in affordability and third in socioeconomic environment. 


2. Madison, Wisconsin, which has a total score of 73.04. It ranked 21st in family fun, eighth in health and safety, fouth in education and child care, ninth in affordability and 21st in socioeconomic environment. 


1. Overland Park, Kansas, which has a total score of 77.16. It ranked 60th in family fun, seventh in health and safety, 24th in education and child care, second in affordability and second in socioeconomic environment. 

Overland Park

On the other hand, here are the five worst housing markets for families:

5. Cleveland, Ohio, which has a total score of 39.15. It ranked 70th in family fun, 143rd in health and safety, 46th in education and child care, 142nd in affordability and 149th in socioeconomic environment. 


4. Hialeah, Florida, which has a total score of 38.91. It ranked 150th in family fun, 51st in health and safety, 84th in education and child care, 149th in affordability and 122nd in socioeconomic environment. 

Florida beach sand water

3. Detroit, Michigan, which has a total score of 38.37. It ranked 32nd in family fun, 127th in health and safety, 102nd in education and child care, 130th in affordability and 150th in socioeconomic environment. 


2. San Bernardino, California, which has a total score of 37.04. It ranked 72nd in family fun, 138th in health and safety, 124th in education and child care, 145th in affordability and 135th in socioeconomic environment. 

California flag

1. Birmingham, Alabama, which has a total score of 36.98. It ranked 122nd in family fun, 134th in health and safety, 108th in education and child care, 138th in affordability and 146th in socioeconomic environment.