Homebuilding took a sharp turn higher to end 2019, but it is far from enough to satisfy the current demand. The U.S. housing market is short nearly 4 million homes, according to new analysis from realtor.com.

Analyzing U.S. census data, the report showed that the 5.9 million single-family homes built between 2012 and 2019 do not offset the 9.8 million new households formed during that time. Even with an above average pace of construction, it would take builders between four and five years to get back to a balanced market.

The shortfall today can be blamed on the epic housing crash of more than a decade ago, brought on by irrational and unscrupulous mortgage lending. With loans available to even the riskiest buyers, builders responded by putting up 1.7 million single-family homes at the peak of the construction boom in 2005, according to the U.S. census. That was about 5 million more than the 20-year average.

When the lion's share of those bad mortgages defaulted, and millions of homes went into foreclosure, home construction plummeted, landing at just 430 starts by 2011. In addition, about 5 million homes were bought by investors and turned into rentals during and after the crisis, further lowering for-sale inventory.

Builders crawled back after that, focusing on mostly higher-end homes, where the margins are more attractive. But lower mortgage rates and the aging millennial population have ignited demand in the last few years, and while builders put up 888,000 homes in 2019, it was still not enough.

"Simply put, new home starts are not keeping pace with demand. Homebuilders have a mountain of opportunity, but a big hill to climb," said Javier Vivas, director of economic research at realtor.com. "The current inventory crisis and the need for 3.8 million new homes means a nearly insatiable appetite from potential buyers, especially in the lower end of the market."

Builders are starting to address the entry-level market, offering smaller, more basic floor plans with stripped-down amenities. That should help, but only if millennials are willing to move further away from the cities.

Adding to the supply crunch is the new desire among baby boomers to age in place. Older Americans are not freeing up their homes at the same rate as previous generations did at their age. Part of that is because so many millennials moved back in with their parents during the recession, unable to afford to either rent or buy their own space. That has left a shortage of move-up homes in some communities.

"Large populations of renters and well-qualified potential buyers with strong incomes are waiting in the wings," added Vivas.