Putting money into real estate and stocks are two popular ways to grow your wealth. Home values have risen significantly, especially with demand being hot in the past few years. A red-hot housing market has inflated values across the globe. And while things have cooled of late, prices are still much higher than they were just a few years ago.
Investing in stocks, however, is also a traditionally safe investment option. The S&P 500, for instance, has averaged an annual long-run return of 10%. Through the power of compounding, those gains can add up significantly over time. After 10 years, a 10% compound annual return would mean your investment is up to more than 2.5 times its original value. After 20 years, it would swell to 6.7 times its original value.
But which of these investment options is better for the long haul: real estate or stocks? Here's what the data says.

Image source: Getty Images.
The stock market has been the winner, and it's not even close
According to data going back to the start of 1995, the Case-Shiller Home Price Index, which tracks housing prices, has risen by more than 310%. By comparison, the S&P 500 index has increased by more than 1,200%. And when you include reinvested dividends, the total returns are more than 2,200%.
S&P 500 vs the housing market data by YCharts
Different housing markets, will, of course, experience different returns. But when taking a broad look at the two investments, it's evident that the stock market as a whole is generally the better long-term investment than real estate.
Profits on real estate can look incredible, and that's because to buy a home you're investing hundreds of thousands of dollars into it. In some markets, you might not be able to even buy a home for less than $1 million. With so much invested into an asset, the profits can be significant, whereas with stocks, investments are typically smaller.
But if, for example, you invested $500,000 into the S&P 500 and it simply rose at its long-run average of 10% for five years, then you'd be sitting on a profit of more than $300,000. If you invested $1 million, then the profit would be more than $600,000. Now these kinds of profits start to become more eye-catching, and that's because the original investment is so significant.
Why investing in stocks can make more sense than investing in real estate
The large numbers from real estate profits can make it seem as though investing in housing can yield better returns. But when you adjust for the size of the investment and you strictly look at the percentage return, the story looks much different, and it makes it more evident that investing in stocks may be the better option.
But there are also other factors that tip the scale in favor of stocks, including liquidity. With stocks, it can be easy to get in and get out of an investment while incurring minimal costs. Investing in real estate, however, can be both time-consuming and costly. Plus, you are tying up money into a single asset whereas with stocks you can diversify across multiple companies or through 500 of the leading stocks as with the S&P 500 index.
Investing in the stock market has yielded better returns over the years and it's a safer long-term strategy. Even if you're not sure what to invest in, tracking the S&P 500 through an exchange-traded fund can be an easy way to invest in the stock market while taking on minimal risk.