San Franciscans need to earn $333,000 a year to buy a median-priced home

A passerby walks by a home for sale on Magellan Ave on Wednesday, July 20, 2016 in San Francisco, California. A passerby walks by a home for sale on Magellan Ave on Wednesday, July 20, 2016 in San Francisco, California. Photo: Michael Noble Jr. / The Chronicle 2016 Photo: Michael Noble Jr. / The Chronicle 2016 Image 1 of / 1 Caption Close San Franciscans need to earn $333,000 a year to buy a median-priced home 1 / 1 Back to Gallery

More Bay Area households could afford to buy a median-priced single-family home in the first quarter of this year compared with the fourth quarter of 2017, as incomes rose more than enough to offset an increase in home prices and interest rates.

Compared with the first quarter of last year, however, affordability got worse, according to a California Association of Realtors quarterly survey released Tuesday.

About 23 percent of Bay Area households earned enough to buy the median-priced home in the first quarter, compared with 21 percent in the fourth quarter of last year and 25 percent in the year-ago period.

The survey calculates the annual household income needed to make the monthly payment (including mortgage, taxes and insurance) on a median-priced single-family home with a 20 percent down payment and a 30-year fixed-rate mortgage at prevailing rates. It then estimates what percent of households in an area earn that much. The result is the affordability index.

In the first quarter, a Bay Area household would have needed at least $186,300 in annual income to make the $4,660 monthly payment on a $900,000 home, with mortgage rates at 4.44 percent. The association figured that 23 percent of Bay Area households earned at least that much, but affordability varied widely by county.

In San Francisco and San Mateo counties, only 15 percent of households could afford a median-priced home, which averaged $1,610,000 and $1,575,050, respectively, during the first quarter. A household would need around $333,000 and $326,000 in annual income, respectively, to buy those homes.

In Solano County, 42 percent of households earned enough ($89,000) to buy a $430,000 median-priced home.

The affordability index stood at 31 percent statewide and 57 percent nationwide in the first quarter.

These numbers understate affordability somewhat because they exclude condos, which are generally cheaper than single-family homes. The association calculated that 39 percent of households statewide could have afforded a condo or townhome in the first quarter.

The numbers also do not take into account a household’s wealth, which can factor into affordability.

Although Bay Area home prices keep hitting record highs, affordability isn’t even close to a record low.

Since the beginning of 2006, when the association started tracking affordability on a quarterly basis, it hit a trough of 10 percent in the second quarter of 2007, just before the housing market went bust. Affordability peaked at 45 percent in the first quarter of 2012, when prices were bottoming out.

The reason affordability isn’t worse is because income growth has been strong. The median household income in the Bay Area rose to $97,249 in the first quarter from $89,017 the same quarter last year.

In its index, the association considers not just the level of income but also the distribution. In the Bay Area, the share of households making $150,000 to $500,000 or more rose 4 percent while the share making less than $75,000 declined 4 percent.

Kathleen Pender is a San Francisco Chronicle columnist. Email: kpender@sfchronicle.com Twitter: @kathpender