Wikimeda commons

CityLab recently did the math on affordable housing, ranking cities in the U.S. based on the average housing costs there.

The following cities are listed based on the percentage of housing that someone with an average income can afford. Because these averages vary from state to state, CityLab adjusted its averages accordingly.

"In most U.S. markets, the majority of homes for sale are within reach of the middle class, and buying is cheaper than renting in all of the 100 largest metros," CityLab wrote.

Did your city make the list?

10 Rochester, New York
Wikimedia Commons

Percent of for-sale homes affordable for middle class, May 2014: 81

Median size of affordable for-sale homes, May 2014 (square feet): 1,400

Percent of for-sale homes affordable for middle class, May 2013: 79

9 Little Rock, Arkansas
Wikimedia Commons

Percent of for-sale homes affordable for middle class, May 2014: 81

Median size of affordable for-sale homes, May 2014 (square feet): 1,600

Percent of for-sale homes affordable for middle class, May 2013: 83

8 Cleveland, Ohio
Wikimedia Commons

Percent of for-sale homes affordable for middle class, May 2014: 81

Median size of affordable for-sale homes, May 2014 (square feet): 1,350

Percent of for-sale homes affordable for middle class, May 2013: 85

7 Detroit, Michigan
Wikimedia Commons

Percent of for-sale homes affordable for middle class, May 2014: 81

Median size of affordable for-sale homes, May 2014 (square feet): 1,100

Percent of for-sale homes affordable for middle class, May 2013: 87

6 Columbus, Ohio
Wikimedia Commons

Percent of for-sale homes affordable for middle class, May 2014: 81

Median size of affordable for-sale homes, May 2014 (square feet): 1,400

Percent of for-sale homes affordable for middle class, May 2013: 87

5 Columbia, South Carolina
Wikimedia Commons

Percent of for-sale homes affordable for middle class, May 2014: 82

Median size of affordable for-sale homes, May 2014 (square feet): 1,700

Percent of for-sale homes affordable for middle class, May 2013: 88

4 Gary, Indiana
Wikimedia Commons

Percent of for-sale homes affordable for middle class, May 2014: 83

Median size of affordable for-sale homes, May 2014 (square feet): 1,500

Percent of for-sale homes affordable for middle class, May 2013: 87

3 Dayton, Ohio
Wikimedia Commons

Percent of for-sale homes affordable for middle class, May 2014: 83

Median size of affordable for-sale homes, May 2014 (square feet): 1,350

Percent of for-sale homes affordable for middle class, May 2013: 89

2 Toledo, Ohio
Wikimedia Commons

Percent of for-sale homes affordable for middle class, May 2014: 84

Median size of affordable for-sale homes, May 2014 (square feet): 1,350

Percent of for-sale homes affordable for middle class, May 2013: 87

1 Akron, Ohio
Wikimedia Commons

Percent of for-sale homes affordable for middle class, May 2014: 86

Median size of affordable for-sale homes, May 2014 (square feet): 1,350

Percent of for-sale homes affordable for middle class, May 2013: 88