A recent study by GoBankingRates rounded up waterfront cities in the US that are surprisingly affordable for the average income earner.

After deducting each city's local annual living expenses from the state's average income, the study found that in 25 cities, the amount left over exceeded 49%.

Of the top 15 affordable waterfront cities that made the list, four are located in New York.

Visit Business Insider's homepage for more stories.

There are many affordable waterfront cities across the US — you just have to know where to look.

A recent study by personal finance platform GoBankingRates found 25 waterfront cities where — after deducting each city's local annual living expenses from the state's average income — the amount left over exceeded 49%.

To gather the final ranking, GoBankingRates looked at the top 112 waterfront cities (oceans and lakes) based on the median listing price, the average state income, and overall affordability.

Read more: 31 US cities where it's cheaper to buy a house than to rent a place

To gather annual living expenses in each city, GoBankingRates first collected the median listing price in each city and found the average annual mortgage cost using Zillow's mortgage calculator. It is important to note that the annual mortgage costs found in this study assume a 20% down payment and a 3.56% 30-year fixed-rate mortgage.

GoBankingRates then used the Bureau of Labor Statistics' 2018 Consumer Expenditure Survey to find the average cost of groceries, utilities, transportation, healthcare and miscellaneous expenditures. Then, using Sperling's Best Places, the survey findings were adjusted to each city's local cost of living. The full methodology is available here.

Of the top 15 affordable waterfront cities that made the list, four are located in New York.

Keep reading for a look at the most affordable waterfront cities in the US, ranked from the lowest to the highest percentage of leftover income.