US-ECONOMY-REAL-ESTATE-INDICATOR-RATE Photo by ANDREW CABALLERO-REYNOLDS/AFP via Getty Images

A new study has ranked the best and worst housing markets in the United States where homes are the most---and least---affordable for first-time buyers. 

The past several years have been difficult for first-time buyers as home prices grew dramatically and the low supply of homes failed to keep up with the demand. Last year, first-time buyers made up 26% of all home buyers in 2023, according to the National Association of Realtors. That is a 34% decrease from a year before and the lowest percentage of first-time buyers on record. 

While home prices did not grow in the first quarter of 2024, prices of houses across the U.S. remained very high for potential first-time buyers. Homes in some markets were listed at prices five times higher than the average income of first-time buyers. 

Here are the most and least affordable housing markets for potential first-time buyers, per NerdWallet's latest First-Time Home Buyer Affordability Report.

Most Affordable Areas for First-Time Buyers

Pittsburg

Pittsburg was the most affordable city for first-time buyers from January to March 2024. Homes in Pittsburg were listed at prices 2.8 times the average income of first-time buyers. That is despite prices in the city rising 11% from last year's fourth quarter. 

Detroit

Detroit comes as the second-most affordable city in the country, with home prices listed 2.9 times a first-time buyer's average annual income. 

Cleveland

During the first three months of 2024, the average home prices in Cleveland came in at 3.0 times the annual income of first-time buyers. It comes in third on NerdWallet's list of most affordable cities for first-time buyers.

Buffalo

Coming in fourth on NerdWallet's list is Buffalo, New York, where home prices are 3.2 times the annual income of potential first-time buyers. 

Baltimore

Baltimore is the last city on NerdWallet's top five most affordable cities in the U.S. for first-time buyers. Home prices in Baltimore average out to 3.4 times the income of first-time buyers.

Least Affordable Areas for First-Time Buyers

Los Angeles

At the other end of the spectrum, Los Angeles topped the list as the most expensive area for first-time buyers. Homes in the city are at least 12 times the annual income of first-timers. 

San Diego

San Diego follows Los Angeles as one of the most expensive cities for first-time buyers. Homes in San Diego are listed 9.3 times the income of first-time buyers. 

San Jose

Home prices in San Jose are 7.7 times the average annual income of first-time buyers, making it the third most expensive city in the country for first-timers.

New York City

Homes in New York City were listed at 7.1 times the average annual income of potential first-timers. 

Boston and Miami

Boston and Miami are tied as the fifth-most expensive cities for first-timers on NerdWallet's list. Home prices in each city were listed, on average, 7.0 times a first-time buyer's annual income.

READ NEXT: National Rent Prices Increased Again in May in the Fastest Pace Recorded in Nearly Two Years: Report