A lot of people will tell you that buying a home is a good investment, but "that couldn't be further from the truth," says Peter Mallouk, a certified financial planner and president of wealth management firm Creative Planning.
"In reality, it's usually a terrible investment," he says. That's because, at the end of the day, owning a home takes money out of your pocket: "You're paying property taxes, you're paying maintenance, you're paying insurance. There are all of these other things that happen with your home that you've got to pay for."
Young homeowners in particular have figured that out the hard way: Underestimating the hidden costs is the No. 1 reason millennials who do own homes have regrets.
Over time, your home might increase in value, Mallouk says, but it probably won't appreciate enough to offset all of the costs. Instead, if you took what you'd save from not buying a house and invested it in something that's likely to grow in value, such as stocks and bonds, chances are you'd end up with more money in the long term.
Say you live in Brooklyn, New York, and pay $2,500 a month to rent. If you buy your own place, you might pay $5,000 a month between your mortgage, taxes and other maintenance costs, Mallouk gives as an example. (Other financial experts estimate that, thanks to home ownership costs, buying could cost you about 40% more than renting.)
"If you take the difference and you save it, that extra $2,500 you're saving in a diversified portfolio is almost certainly, over a long period of time, going to grow to be worth more than what your home equity would have been worth if you had just put the money into a home," he says.
Ramit Sethi, self-made millionaire and author of "I Will Teach You to be Rich," has made the same argument. Think about it this way, Sethi suggests: "Generally we can assume that over the long term, if we invest in a low-cost diversified index fund, we get about 7%" in terms of annualized returns. "Can you beat that in your area, over time, with real estate appreciation?"
Both Sethi and Mallouk emphasize the importance of crunching the numbers before buying a home: Take stock of your own financial standing and then look into the average cost of buying versus renting a home in your area. Try to project whether or not buying makes sense for you, and ask yourself whether you're better off renting and putting the money that you'd save into investments such as mutual funds.
"If you run the numbers, like me, you might discover that for where you live it actually makes no financial sense to buy," says Sethi. "Are there other reasons to buy? Of course. Maybe you want to buy because you want to knock that wall down. Maybe you want to buy because you want your kids to go to a certain school. Fine. But run the numbers."
"For the biggest purchase of your life," he adds, "you should know all the math and how it plays out 20 years in the future."
One major benefit that comes with buying a home is that it can be a type of "forced savings" because, by making monthly payments on a mortgage, you're using money in a constructive way by putting into an asset that you could later sell. As Mallouk explains: "You've got to find the money every month to put into your home to pay that mortgage, so it forces you to build equity." Keep in mind that, when you have a mortgage, you will pay interest to your lender.
Still, Mallouk contends, if you're disciplined enough to take whatever savings you have from renting instead of buying and invest it, "you're going to be in far better shape than if you had invested that in a property that continues to take money from you."
Like this story? Subscribe to CNBC Make It on YouTube!