Over the last year, home prices have risen in 49 of the biggest 50 metro areas in the United States.

At the same time, mortgage rates have hit seven-year highs, making things more expensive for any prospective home buyer.

With this context in mind, today’s map comes from HowMuch.net, and it shows the salary needed to buy a home in the 50 largest U.S. metro areas.

The Least and Most Expensive Metro Areas

As a reference point, Visual Capitalist's Jeff Desjardins points out that the median home in the United States costs about $257,600, according to the National Association of Realtors.

With a 20% down payment and a 4.90% mortgage rate, and taking into account what’s needed to pay principal, interest, taxes, and insurance (PITI) on the home, it would mean a prospective buyer would need to have $61,453.51 in salary to afford such a purchase.

However, based on your frame of reference, this national estimate may seem extremely low or quite high. That’s because the salary required to buy in different major cities in the U.S. can fall anywhere between $37,659 to $254,835.

The 10 Cheapest Metro Areas

Here are the cheapest metro areas in the U.S., based on data and calculations from HSH.com:

After the dust settles, Pittsburgh ranks as the cheapest metro area in the U.S. to buy a home. According to these calculations, buying a median home in Pittsburgh – which includes the surrounding metro area – requires an annual income of less than $40,000 to buy.

Just missing the list was Detroit, where a salary of $48,002.89 is needed.

The 10 Most Expensive Metro Areas

Now, here are the priciest markets in the country, also based on data from HSH.com:

Topping the list of the most expensive metro areas are San Jose and San Francisco, which are both cities fueled by the economic boom in Silicon Valley. Meanwhile, two other major metro areas in California, Los Angeles and San Diego, are not far behind.

New York City only ranks in sixth here, though it is worth noting that the NYC metro area extends well beyond the five boroughs. It includes Newark, Jersey City, and many nearby counties as well.

As a final point, it’s worth mentioning that all cities here (with the exception of Denver) are in coastal states.

Notes on Calculations

Data on median home prices comes from the National Association of Realtors and is based on 2018 Q4 information, while national mortgage rate data is derived from weekly surveys by Freddie Mac and the Mortgage Bankers Association of America for 30-year fixed rate mortgages.

Calculations include tax and homeowners insurance costs to determine the annual salary it takes to afford the base cost of owning a home (principal, interest, property tax and homeowner’s insurance, or PITI) in the nation’s 50 largest metropolitan areas.

Standard 28% “front-end” debt ratios and a 20% down payments subtracted from the median-home-price data are used to arrive at these figures.