If you live in or near Boston, you already know that housing is expensive. Rents and mortgages eat up a growing share of middle-class incomes. And among the poor, affordable housing is as rare as it is essential.

But if you’re wondering what the solution is, so is everyone else. Boston’s housing woes are far from unique. Housing costs in Greater Boston are very much in line with peer cities like Seattle, Washington, D.C., and Portland, Ore. — and far below what you find in a truly overheated market like California’s Bay Area.

Has any city found the secret to balancing economic dynamism with affordability? Not really. But if Boston doesn’t make room for low- and middle-income residents soon, it could ultimately drain the region of diversity and make it harder for businesses to find the workers they need — exactly what is happening in San Francisco.

Advertisement

Boston’s peers

To get some perspective on the Boston-area housing market, it’s worth taking a quick trip out West, where things are really out of control.

In San Francisco, the median sale price is well over $700,000, and just south in Silicon Valley it’s closer to $1 million. Those are the highest prices in the nation. Greater Boston comes in 13 slots down the list, with a median sale price of $379,000.

And it’s not just sale prices. Rents, too, are 20 percent more expensive out West, according to the real estate research organization Reis.

When it comes to housing, Greater Boston looks more like Portland, Seattle, and D.C., a trio of coastal cities where median house prices tend to fall in the $300,000 range, with fair market rents for a two-bedroom hovering around $1,500 (a bit more in D.C., a bit less in Portland).

And while you might hope to make Boston’s housing even less expensive, the sad news is there aren’t a lot of obvious examples to follow. Most of the cities that have managed to keep housing prices low fall into one of two categories, neither of them necessarily right for Boston.

Advertisement

■
There are cities like Atlanta, Dallas, and Raleigh, where land is plentiful, density is low, and sprawl is a guiding principle of development.

■
Alternatively, places like Chicago and Philadelphia remain relatively cheap because their economies aren’t growing as fast and jobs are less abundant.

Who pays the price?

Perhaps the brightest light in the story of Boston’s housing market is that incomes are high, too — some of the highest in the country.

If your family income is close to the median, you can probably afford a place in Greater Boston. Over half of all homes on the market would fit your budget, based on an estimate from the National Association of Home Builders.

That doesn’t mean you’ll have your pick of communities. Greater Boston is a large and diverse place, with very high housing costs around the Boston core and more-affordable areas generally farther out on the periphery — which could mean higher transportation costs and longer commutes.

But the very fact that there are less-pricey options within commuting distance makes Boston different from a place like San Francisco, where only 10 percent of homes fit within the budget of a family that earns the median wage.

Of course, it’s also true that half of all people in Greater Boston earn less than the median. And for them, housing costs can be unmanageable.

Advertisement

More than 40 percent of lower-middle-class households in Greater Boston are paying more for housing than their incomes can really support, according to a recent study from the Urban Land Institute.

And when paying the rent is unaffordable, families can’t stay. An analysis from the Trulia real estate site found that Greater Boston loses a disproportionate number of families who earn less than $60,000 annually — more than decamp from New York or Los Angeles.

Boston’s future

Over the past five years, home prices in Greater Boston have risen about 15 percent, far less than in Seattle and Portland.

Even stereotypically low-cost cities like Dallas and Atlanta are experiencing price growth more rapid than Boston’s.

Yet, even if Boston is faring better than other cities, housing prices are still going up faster than wages or inflation, which means shelter gets less affordable each and every year.

And there’s another problem: We need to attract more people to support our growing economy and compensate for the looming wave of baby boomer retirements. An estimate from the Metropolitan Area Planning Council
said that for Boston to thrive economically, we might need as many as half a million new people over the coming decades.

But where to house them? And how to keep a growing population from driving housing prices ever higher?

There is no clear consensus on how to accomplish this, and each of the big ideas has its share of promises and pitfalls. Possible approaches include:

Advertisement

■
Market urbanism, which aims to make housing affordable by building more of it — including through looser zoning laws, streamlined regulatory checks, less NIMBYism, and a greater willingness to let developers meet the needs of buyers and renters.

■
A right to housing, which could mean a vastly expanded voucher system to ensure everyone has the resources for rent.

■
Rent control, which would cap the cost of selected apartments throughout the region to ensure a better mix of affordability.

■
Social housing, when large nonprofits or government entities take direct control of buildings, guaranteeing reasonable rents to those in need.

There’s also the choice of ongoing incrementalism, where we continue to take a case-by-case approach to building and hope that market forces keep prices in check.

That approach at least has the virtue of humility. After all, no US city seems to have found a foolproof way of balancing good jobs, high wages, great education, and restrained housing costs.

If none of these measures work, though, Boston may go from an expensive city to a truly unaffordable one. We know that’s a possibility. Just look at San Francisco.

Evan Horowitz digs through data to find information that illuminates the policy issues facing Massachusetts and the US. He can be reached at evan.horowitz@globe.com. Follow him on Twitter @GlobeHorowitz.