The biggest obstacle to homeownership for many potential buyers is not the monthly mortgage bill, but the high down payment. The 20 percent required to qualify for a typical mortgage for a median-priced home in the United States (about $455,000) comes out to about $91,000, a formidable amount of cash.

Saving that much would take years for most households, but a recent study by RealtyHop dug deeper, comparing income and median local home prices to locate where a down payment could be compiled faster. Some 1.8 million RealtyHop listings in the 150 largest US metropolitan areas were examined and a savings rate of 20 percent of gross receipts per year was applied to the formula. Single-family homes, townhomes, condominiums, and cooperatives were included.

It’s not as simple as earning more, because the places where households earn the most also tend to have the highest home prices. Consider San Francisco, where the median household earning $126,187 a year would need 10.5 years to save the required down payment of $265,000 for a median-priced home costing $1.325 million. Three other California metro areas—Long Beach, Los Angeles, and Glendale—require even more time to save.

But it hasn’t been everywhere for a decade. On a third of the 150 meters, saving for a down payment would take less than five years. If you’re in a hurry, consider Detroit, the metro area where savings were found to build faster. There, the average household earning $34,762 would need just two and a half years to save a down payment of $17,780 for the median-priced home that costs $88,900.

This week’s graph, based on data from RealtyHop, shows the 10 metro areas where saving would be fastest and the 10 where it would be slowest.

For weekly email updates on residential real estate news, sign up here.