Buying a home, and being able to keep it, has always been a cornerstone of the American Dream. That’s why perhaps there’s been so much angst lately over the fact that many 20- and-30-something Americans may never be able to afford even a fixer-upper.

Recently, The Wall Street Journal wrote that a mixture of student debt, declining credit scores, and lower salaries for youngish Americans means it will be a long time, if ever, before many Millennials will be able to afford to buy a house. Taylor Tepper, a Millennial writing on, lamented that, despite earning a combined income of $110,000 between him and his spouse, he would likely have to choose saving for his kids’ college education over buying a house.

Just 22% of 30-somethings who had student debt also owned a home last year. That’s down from 34% in 2008, according to the New York Federal Reserve. At an investment conference in May, Bond guru Jeff Gundlach of Doubleline said that he believes it’s unlikely homeownership, particularly among Millennials, will experience a rebound.

But here’s the twist: not buying a house, even not being able to afford one, might end up being the best thing that will ever happen to Millennials, financially speaking.

The average house in America today costs $213,400, according to the National Association of Realtors. If you want to get a loan to buy that house in today’s market and likely for the time being, you will have to put at least 20% down. (Unless you qualify for a FHA loan, but those loans come with additional fees.) That’s $42,680. The rest, $170,720, will come from a mortgage loan, which, at current interest rates, will run you $834.84 a month. You get back some of that as a tax deduction. Factor that in and you’ll be paying a bank around $8,600 a year to live in your house. Over 30 years, that’s $274,580.

Rental prices, unlike mortgage rates, have been going up recently. And, these days, the average rental around the country costs $1,018.87 a month, according to Numbeo, which tracks what people spend in their daily lives. The average annual rental rate is $12,226. No tax deduction here. But there is inflation, which means rental prices are likely to go up, let’s say 2% a year, roughly in line with inflation. By that math, renting for the next 30 years will cost $496,003.

Stop there, and it looks like being a homeowner will save you a lot of money. And that’s the calculation most people are doing when they figure becoming a homeowner will save then a lot of money. It won’t.

That math disregards the down payment. By putting the cash toward you house, you are essentially making a bet on real estate prices. And real estate, even including the boom in prices in the 2000s and the recent rebound, hasn’t been a great investment, at least compared to alternatives like the stock market.

Over the past 30 years, real estate prices according to the S&P Case-Shiller index, increased by 143%. In the same time, though, an investment in the S&P 500 would have yielded a 1,073% return.

Here’s how that plays out: A house bought today for $213,400 would be worth $518,562, delivering a gain of $305,162. Subtract what you paid in interest on the loan, and you are looking at a profit of $30,582. But not really. Remember, houses are money pits. Pipes freeze. Roofs leak. Paint peals. Mortgage researcher HSH Associates, which tracks housing costs, says you should figure on spending about 1% of the value of your house on maintenance.

And don’t forget about taxes. Real estate website Zillow recently did a survey concluding that the average property tax bill in America was $2,800. A good ballpark figure for upkeep and taxes for 30 years is $275,000. That means owning a home actually comes at a cost of about $245,000 over 30 years.

Now, the math for renting: That $42,680 invested in the S&P 500 would turn into just over $500,000 over three decades, if the market repeats what it has done over the past 30 years. Unlike your house, though, you have to 15% in taxes on those gains, or $75,000. Subtract that out and all the rent you paid over 30 years and the total cost of renting comes to $71,000 for 30 years, or about $170,000 less than it costs to own.

And that’s if you buy a house today. Most economists believe interest rates, currently near historic lows, are heading upward. That will tip the scales even more heavily in favor of renters.

Even more amazing is that renters come out ahead even though the tax code heavily favors homeowners. The mortgage tax credit and other payments the government makes to subsidize housing, including supporting government control mortgage insurance companies Fannie Mae and Freddie Mac, cost the country about $100 billion a year. If those tax breaks were eliminated, that would shift a good portion of the tax burden onto older, home-owning Americans and away from Millennials.

There are just too many homeowners for that to be popular in Washington. But if Millennials increasingly choose to be long-term renters, we could see a growing portion of voters who would welcome change.

What about all the other benefits of homeownership? Some studies have shown that children of homeowners tend to do better in school than renters. But those studies have more to do with household stability than renting versus owning. Long-term renters who tend to stay in the same place seem to get the same positive family benefits that owners do. Families that buy houses they can’t afford throwing their financial lives into disarray probably end up with all the negatives of renting, and then some.

In the end, angst about whether Millennials can afford a home is really about a very old source of intergenerational anxiety: whether the next generation of Americans will be better off than their predecessors. Opportunity to move up the economic ladder in America does seem to be shrinking. But pushing homeownership on the next generation will only make that worse.