The uber-wealthy city of Atherton has some of the most expensive homes in the U.S. But on a per-square-foot basis, it doesn’t have the most valuable real estate in the Bay Area.

With the notable exception of San Francisco, high mortgage rates and a volatile job market have cooled housing markets across the Bay Area. But home values in the region’s premier job centers still demand a high premium. In Palo Alto’s 94301 ZIP code, the typical home was valued at more than $2,000 per square foot in March, the most of any ZIP code in the Bay Area with at least 5,000 residents, according to data from real estate brokerage Zillow. Atherton’s was just a bit lower, at more than $1,900.

Compare that to the 94571 ZIP code that encompasses the town of Rio Vista and its surroundings in Solano County, where homes run for less than $300 per square foot. That means a $1 million home would have a square footage of roughly 3,600 square feet.

Living space took on renewed value during the pandemic, when remote workers pressed into the outer Bay Area in search of extra bedrooms and home offices, driving up home prices in the region’s relatively affordable pockets.

Of course, space isn’t everything. Some tech employees have returned to San Francisco and Silicon Valley to live near the offices of artificial intelligence startups, trading a longer commute for a smaller bedroom. And families often prioritize school quality — an oft-cited reason for high prices in Palo Alto and Tri-Valley — over raw square footage. Aesthetics, community ties and proximity to shopping centers can also play a role.

Zillow’s data, which includes both single-family homes and condominiums, is based on the projected price for which a mid-tier home would sell in a ZIP code. That means its estimates differ from a neighborhood’s median price per square foot, which is usually based on the prices of homes that have sold or are actually on the market.

San Francisco’s home values per square foot have dropped sharply since 2019, after adjusting for inflation, the data shows — from about $1,200 per square foot to roughly $1,000. For a 1,500-square-feet home, that’s a difference of $300,000. But the recent AI boom has brought a wave of cash-flush buyers looking for luxury homes in the city, pushing up prices.

The size of single-family homes built in the Bay Area swelled in the late 1980s, according to other Zillow data, though in recent years new homes have become a bit smaller.