For those earning an average income, it can seem impossible that you could ever save enough cash to be able to afford a down payment on a home. But depending on where you live, the true length of time can vary. In Los Angeles, it could take more than four decades to sock away enough, while that time shrinks to just seven years in Detroit where the median household income is low, but the cost of housing is more affordable.

In its 2019 Home Affordability Report, home co-investment company Unison calculated how long it would take save up enough for a 20% down payment in various cities across the U.S. based on the median income and median home values in each place. To determine how many years you'd need to save, Unison assumed a savings rate of 5% of your gross income per year.

Below, check out how long it would take to afford a down payment on a home if you earn the median income in 10 major U.S. cities, ranked from least to most time.