The Pew Research Center defines the US middle class as those earning 67% to 200% of the median household income.

Middle-class Americans earned about $40,425 to $120,672 in 2016, according to Pew's definition, but middle-class incomes vary at the state and city levels.

Some Silicon Valley residents earning $400,000 consider themselves to be in the middle class, a survey found.

Some residents of Silicon Valley self-identify as being in the middle class, even though their salaries dwarf those of many Americans.

The Pew Research Center defines the US middle class as those earning two-thirds to twice the median household income, which was $60,336 in 2017, meaning middle-class Americans were earning about $40,425 to $120,672.

But that number shifts as its broken down by state and even by city.

The Palo Alto Weekly, a local paper in Palo Alto, California, asked residents to report their household income and perceived social class. Out of more than 250 respondents, 81 with incomes between $10,000 to $399,999 said they were "middle class."

"Middle class" is a term used broadly — and often incorrectly — even though it can be quantified with US government data. And while the US middle class has been shrinking for decades, most Americans still consider themselves part of it. Many of the high-earning Palo Alto residents noted the high cost of living was one of the reasons they identified as being in the middle class.

But whether you're in the "middle class" varies depending on where you live.

To get a sense of what it looks like in 25 US cities, Business Insider pulled census data from the 2017 American Community Survey for the largest metropolitan statistical areas. For clarity, we listed the largest city in the MSA (some include more than one).

Below, find out how much income you have to earn to be considered in the middle class in 25 metro areas.

This is an updated article originally reported by Abby Jackson.