A shocking number of Americans live in housing they can't afford, according to Harvard study

Harvard study: Almost 40 million Americans can't afford to pay for housing

According to new research by Harvard University, almost 40 million Americans "live in housing they cannot afford." Homeownership has gone down and rental prices keep going up, meaning that millions of residents are forced to pay more than they reasonably should.

In the study, the researchers determined affordability by people's ability to pay 30 percent of their income or less on the cost of housing, which may include their mortgage, insurance and taxes.

Homeownership keeps declining, according to the Joint Center for Housing Studies' detailed and comprehensive 2017 State of the Nation's Housing report, in part because homes prices in many markets have continued to go up while wages have not kept pace. In 2016, "the homeownership rate fell to 63.4 percent, marking the 12th consecutive year of declines."

A lot of people who would like to buy are stuck renting, Harvard reports: "The surge in rental demand that began in 2005 is broad-based — including several types of households that traditionally prefer homeownership."

At the same time, renting is more expensive, as "rent gains across the country continue to far outpace inflation." And supply is tight. Since most of the new units being built are at the high end, "the number of modestly priced units available for under $800 declined by 261,000 between 2005 and 2015, while the number renting for $2,000 or more jumped by 1.5 million."

For a lot of people, especially in the pricey major metro areas where so many of the good jobs are, the situation looks grim. NBC News sums up the findings this way: "Over 38 million American households can't afford their housing, an increase of 146 percent in the past 16 years."

Even people lucky enough to own already aren't immune. Harvard reports that "the typical homeowner has yet to fully regain the housing wealth lost during the downturn." Although home values have gone up by as much as 40 percent in swaths of California, Florida and New England since 2000 — and in 12 metro areas have even doubled — they have remained stagnant or even gone down by as much as 46 percent in much of the South and the Midwest.

Jason Chaffetz: Members of Congress should get $30,000 a year in housing allowance

Can you afford housing? That depends largely on where you are. In terms of purchases, only 19 percent of residents of Honolulu, and only 25 percent of residents of Los Angeles and San Francisco, can afford to a buy median-priced home there.

This situation is particularly hard on the working poor. Across the U.S., "70.3 percent of lowest-income households face severe housing cost burdens," including "nearly nine out of 10 lowest-income renters" in places like Cape Coral and Las Vegas. That means more than 50 percent of their income must go toward housing and can't be used to either pay down debt or add up to savings.

Like this story? Like CNBC Make It on Facebook.

Don't miss:

Professionals in these cities take home the most money after rent and taxes

Editor's note: This article has been revised and updated.