Living in a major U.S. city can be expensive — but which city is the most expensive? To find this answer, we’ve calculated a cost of living index, having taken into account a city’s median income and having compared it to what it costs for homeowners and renters to live comfortably in the city.

These numbers were derived from Go Banking Rates, which was able to ascertain the ideal incomes in major U.S. cities using the 50/20/30 rule. This rule suggests you take 50% of your income for necessities (housing, food, healthcare, transportation), 20% for savings and 30% for personal items you don’t need but want.

As predicted, the most expensive cities show a disparate number between the median and ideal income, which is further proof of how costly these cities are for residents. So, without further ado, here are the 10 most expensive U.S. cities to live in.

San Jose, California

Credit: Uladzik Kryhin/Shutterstock
  • Average Ideal Income: $170,586
  • Median Income: $96,662
  • Cost of Living Index: 1.76

At the heart of Silicon Valley is San Jose, California. Serving as headquarters for companies like eBay and Adobe Systems, this city is a huge draw for tech employees. But even with a whopping median income of $96K, it costs significantly more to live comfortably among the tech industry’s best and brightest.

Honolulu, Hawaii

Credit: Izabela23/Shutterstock
  • Average Ideal Income: $157,765
  • Median Income: $80,078
  • Cost of Living Index: 1.97

Living in the middle of the Pacific Ocean may be beautiful, but it’s not cost effective. Residents of Honolulu have to pay a high premium for goods to be shipped to the remote metropolis. Its high cost of housing is no help, and even though a salary of $80K may be high in some parts of the U.S., it doesn’t add up to much in Honolulu.

Boston, Massachusetts

Credit: Sean Pavone/Shutterstock
  • Average Ideal Income: $124,901
  • Median Income: $62,021
  • Cost of Living Index: 2.01

In order to pay the bills, save for the future and enjoy the trappings of the city, a Bostonian has to make $125K annually. And that’s just Boston proper. When you account for the metropolis area, including cities like Cambridge, Somerville and Brookline, Beantown remains one of the most expensive places to live in the U.S.

San Francisco, California

Credit: Andrew Zarivny/Shutterstock
  • Average Ideal Income: $197,250
  • Median Income: $96,265
  • Cost of Living Index: $2.05

Living in a costly city like San Francisco means you can earn six figures and still be considered low income. In fact, the average ideal income for renters and homeowners is $100,000 more than the median city salary. That is a huge deficit. But when the average rent for a one-bedroom apartment is nearly $4,000, what else would you expect?

Oakland, California

Credit: cdrin/Shutterstock
  • Average Ideal Income: $136,778
  • Median Income: $63,251
  • Cost of Living Index: 2.16

San Francisco’s neighboring city of Oakland fares no better in terms of affordability. According to Sperling’s Best Places, the total cost of living in Oakland is twice the national average. This may be attributed to the fact that housing costs four times as much in Oakland than the rest of the U.S. It just goes to show that crossing the Bay Bridge doesn’t drive down the cost of living in this pricey U.S. region.

Long Beach, California

Credit: Worachate Joe Khongthon/Shutterstock
  • Average Ideal Income: $131,702
  • Median Income: $58,314
  • Cost of Living Index: 2.26

Living in Long Beach, a coveted Orange County enclave, may not be as idyllic as it sounds. Although you’re surrounded by white sand beaches and swaying palm trees, this California beach town has insanely high housing costs. With a median home cost of $400,000, buying a home in Long Beach is out of reach for most Americans. However, according to Go Banking Rates, it may be easier for renters in Long Beach, who need to earn $14k less than their mortgage-paying neighbors.

New York, New York

Credit: Nido Huebl/Shutterstock
  • Average Ideal Income: $138,500
  • Median Income: $57,782
  • Cost of Living Index: 2.40

Recently ranked as one of the most expensive cities in the world, there’s no doubt that the cost of living in New York is exorbitant. The price of utilities, transportation, housing and food simply costs more when you choose to live in New York, according to Sperling’s Best Places. Plus, if you’re looking to own a home in the Big Apple, Go Banking Rates recommends you earn $150K a year, which far exceeds the median salary of an average New Yorker.

Los Angeles, California

Credit: Andrew Zarivny/Shutterstock
  • Average Ideal Income: $143,300
  • Median Income: $54,501
  • Cost of Living Index: 2.63

Thanks, once again, to the state’s high housing costs, Los Angeles takes the cake as the most expensive city for California residents. People are drawn to L.A. for various reasons, such as the fabulous weather, a strong job market, the entertainment industry and the chance to achieve a healthy lifestyle. Unfortunately, with a median income of $54K, there are many people who can’t live up to this extremely high cost of living.

Denver, Colorado

Credit: f11photo/Shutterstock
  • Average Ideal Income: $106,128
  • Median Income: $38,991
  • Cost of Living Index: 2.72

In recent years, Denver’s cost of living has been rising steadily, making it one of the most expensive cities to live in the U.S. The city’s healthy job market has brought an influx of residents looking for good paying jobs and a high quality of life. And while the quality of life is quite good in Denver, sadly it has become unaffordable to many residents. This is mainly due to the rising cost of housing, which rivals many of the biggest cities in the U.S.

Miami, Florida

Credit: Mia2you/Shutterstock
  • Average Ideal Income: $107,245
  • Median Income: $33,999
  • Cost of Living Index: 3.15

Miami, Florida, takes the shocking number one spot as the most expensive city to live in the U.S. The extreme deficit between the median income ($33K) and the ideal income ($107K) demonstrates that the city is too costly for the average citizen. While people love living in Miami for its year-round sunshine and lively nightlife, it’s clear that not everyone can afford the trappings of this high-priced city.