The least affordable cities in the US revealed - and THREE are in California 

California has hundreds of miles of pristine coastline, sunny weather year-round, dozens of national parks, top cuisine and great job opportunities.

The problem is that living there is not cheap.

It has the priciest gas at $5 a gallon, and is among the most expensive for groceries and eating out.

Now, a new study by RealtyHop shows just how hard it is for locals to buy a house there - even with the typically higher salaries in the state. 

In fact, California is home to three of the five least affordable places to buy a home in America.

Los Angeles tops the list. There, 'average families making the median income in the city must now expect to spend a whopping 99.33 percent of their income on home ownership costs.'

RealtyHop looked at the average home price in each city - and worked out what the payments would be on a typical mortgage. They also looked at the average annual income in each city.

The least affordable cities are the ones where the biggest chunk of monthly pay goes towards the mortgage. 

In the case of LA, it was all of it.

The average income was based on that for a family - of two adults - rather than a single person, who would find it even harder.

Spending more than 30 per cent is considered as unaffordable.

Homebuyers in 88 of the major cities would need to spend more than that - seven more cities than in April.

In third place, down the coast from LA, is Irvine in Orange County. There, families earning the average income would need to spend 85 per cent on home costs. As well as the mortgage, these are property tazes and insurance.

As one of the safest cities in the US, close to the beach and the stunning new $2 billion mall, it is a popular place to live.

In fact, homes there are on average $1.475 million. That is more than LA, but salaries are also higher in Irvine.

At five is Long Beach, another city on the ocean south of LA. Homes are cheaper at an average of $800,000 but lower salaries mean 70 per cent of income is needed fo the typical family.

Miami is number two and New York City number four.

The Florida city was once the most unaffordable in the US but home prices are falling. The median list price fell to $710,000, and the average family will spend $4,378 monthly on a mortgage.

In New York, a family with an average income would spend 76.63 per cent on a home with a median list price of $850,000. 

In the 25 most unaffordable housing markets nationwide, homeowners spend at least 49 perent of their income on homeownership costs.

Los Angeles is the least affordable city in America. Here, a typical family would have to spend all their monthly income to pay the mortgage on a typical home

Detroit is one of the most affordable

Four of the top five least affordable housing markets became even more expensive in May: Los Angeles, Irvine, New York City, and Long Beach.

And housing costs became less affordable in all five of the more affordable housing markets this month: Toledo, OH, Detroit, MI, Fort Wayne, IN, Wichita, KS, and Buffalo, NY.

Methodology 

Median home prices are calculated using over 800,000 listings in the RealtyHop database over the month prior to publication.

To calculate the index, the following statistics were used:

1) Median household income

2) Median for-sale home listing prices via RealtyHop data

3) Local property taxes

4) Mortgage expenses, assuming a 30-year mortgage, 7.125% mortgage interest rate, and 20 percent down payment.