The most expensive ZIP code in DC isn't the neighborhood of Bezos, Kushner and Obama

The income you need to afford a home in the biggest U.S. cities

When you think of Washington, D.C., you might picture the White House, or the posh neighborhood of Kalorama, where Jeff Bezos is renovating his mansion alongside such wealthy, high-profile neighbors as Ivanka Trump and Jared Kushner and the Obamas.

In the nation's capital overall, the median home value has climbed to $560,704, compared to a national average of $213,146. But in the most expensive ZIP code in D.C., prices can be nearly twice that.

That's according to financial website GOBankingRates, which collected median home values and mortgage data from Zillow, as well as Bureau of Labor Statistics-based cost of living data for 48 states and the District of Columbia, to identify the nation's most expensive ZIP codes. The site finds that D.C.'s most expensive ZIP is 20015, where the average home is worth about $1 million.

How much more it costs to own vs. rent in your state

"ZIP code 20015 covers the D.C. neighborhood that straddles the Maryland border and is south of both Chevy Chase and Silver Spring," notes GOBankingRates, adding that, "over the years, the nation's capital has earned a reputation for its escalating cost of living."

To calculate exactly how much you'd need to earn to live there comfortably, GOBankingRates used the 50-30-20 budget rule: 50 percent of your income would be used to cover necessities, 30 percent is discretionary income and 20 percent is allocated to savings.

"Monthly costs were totaled and multiplied by 12 to get the annual dollar cost of necessities in each ZIP code," writes GOBankingRates. "This dollar amount for necessities was then doubled to find the actual annual income needed to live in the location."

Zillow Home Value Index for 20015. Data through Mar 31, 2018.

Based on that data, here's how much it costs to live in 20015:

  • Necessities: $75,939
  • Splurges: $45,563
  • Savings: $30,376
  • Total income needed: $151,878

While home values have declined a bit over the past year in 20015, Zillow predicts they could rise nearly 2 percent within the next year.

If you're looking for a home, experts suggest making sure you're ready to transition from renting. Here are some tips to help you get started.

Like this story? Like CNBC Make It on Facebook!

Don't miss: This is the most expensive ZIP code in California—and it's not in San Francisco or LA

Video by Andrea Kramar

Location alone won't determine if your home is a great investment, but this will