The era of unusually affordable housing has ended, meaning America’s housing affordability has returned to average historical levels.

While this means homes are no longer cheap on a national basis, Redfin’s affordability report suggests the market is still relatively affordable for America’s middle-class families.

According to Redfin’s data, in 68 of the 88 most populous American housing markets, a median-priced home is still affordable to families earning the area’s median household income.

This is especially so for middle-class families living in Detroit, where it takes only $26,690 per year to purchase a home at the area’s median price point.

Detroit’s price point is less than half of the area’s $56,339 median income, making it the nation’s most affordable metro for middle-class families, according to Redfin.

Redfin Chief Economist Daryl Fairweather said people who live in places like Detroit, Pittsburgh and Cleveland tend to earn lower salaries than people in expensive coastal areas, but in many ways the Midwesterners’ quality of life is better.

“Even though they may make less money, it’s easier to purchase a home and build equity while providing for a family,” Fairweather said. “It’s no secret there’s an affordability crisis in high-priced places like the Bay Area, where modest homes can sell for well over $1 million. But in most of the country, homes are still affordable on the typical local income.”

Unfortunately, this cannot be said for middle-class families living in California’s expensive housing market. According to Redfin’s research, the five least affordable metros are all located in the Golden State.

“Analyzing just home prices without considering income for a particular area doesn’t provide the entire picture of housing affordability and neither does considering income without its relationship to home prices,” Redfin writes. “Places like San Francisco and San Jose, for instance, are home to some of the highest median household incomes, but even those aren’t nearly enough to afford the areas’ sky-high housing prices.”

If you wanted to purchase a typical home in San Francisco, you would need to earn an annual salary of more than $265,000. This is alarming, as the typical family in the area earns a median income of $92,714, and the area’s home prices climbed to a median of $1.42 million in July.

This means the typical middle-class family in San Francisco would need to nearly triple their annual income to comfortably purchase a home in their hometown.

In the Anaheim metro, which ranked as the second-least affordable market for middle-class families, a household would need to earn $135,554 per year to afford the typical home. That’s more than double the area’s median household income of $65,331, according to Redfin.

The story is similar in San Jose, where a household would need to earn more than $215,000 annually to afford the typical home. Redfin notes this total more than doubles San Jose’s median household income.

“Many people who make what would seem like a lot of money in most parts of the country cannot afford to purchase a single-family home, townhouse or condo in the Bay Area,” Redfin agent Kalena Masching said. “Home prices are simply unattainable to most prospective homebuyers I meet unless they’re willing to commute an hour or two to work every day. Even the residents who could afford to pay more than $7,000 a month for a mortgage payment have a hard time saving for a down payment because rents are so high. A large portion of homebuyers in the area are receiving help with down payments from their family.”

These are the top five most affordable housing markets for middle-class families: 5. Pittsburgh, Pennsylvania 4. Buffalo, New York 3. Dayton, Ohio 2. Rochester, New York 1. Detroit, Michigan

NOTE: The metro areas included in Redfin’s analysis each have a population of 750,000 or above. The median income for each metro is based on data from the 2017 American Community Survey five-year estimate, and the median home price for each metro is based on Redfin data from sales in July 2019.