This post was originally published on this site

Editorial Note: Forbes may earn a commission on sales made from partner links on this page, but that doesn’t affect our editors’ opinions or evaluations.

Though you may be a proud homeowner, you probably don’t love the thought of having to make a mortgage payment each month for the next few decades. But considering how well the stock market has been performing lately, it might feel like you’re missing out by not investing more.

So what’s the right answer: Should you pay your mortgage early or invest your extra funds? Here’s what you should know to help you make a decision.

Pay Mortgage Early or Invest: What Does the Math Say?

You probably dream of the day when you no longer have a mortgage payment hanging over your head. Being debt free is an admirable goal, but it might not make the most sense financially. Especially now, with mortgage rates so low, it’s cheap to hold debt. That leaves the opportunity to grow your wealth more through other investments.

Let’s take a look at an example. Say you have a 30-year mortgage of $200,000 with a fixed rate of 4.5%. Your monthly payments would be $1,013 (not including taxes and insurance), according to our mortgage calculator, and you’d spend a total of $164,813 in interest over the life of the loan.

Now let’s say that you’re able to come up with an extra $300 per month to put toward your mortgage. You’d shave off 11 years and one month from your repayment period, plus save $67,816 in interest.

On the other hand, you could take that $300 per month and invest it in an index fund that tracks the S&P 500 Index instead. Historically, the S&P 500 has returned an average of 10% to 11% annually since its inception in 1926 through 2018. If you want to be extra conservative, however, we can assume an average annual return of 8% on your investment.

At the end of 19 years (about the length of time it would take to pay your mortgage early), you would have $160,780. That’s more than double your potential interest savings. In fact, after that length of time, you’d have about $105,487 left on your mortgage. If you decided to pay your mortgage early after all, you could use your investment funds and still have $55,293 left over.

Reasons to Pay Your Mortgage Early vs. Invest

From a financial perspective, it’s usually best to invest your money rather than funneling extra cash toward paying your mortgage off faster. Of course, life isn’t just about cold, hard numbers. There are many reasons why you might choose either to pay your mortgage early or invest more.

Benefits of Paying Off Your Mortgage Early

  • Interest savings: This is one of the biggest benefits of paying your loan off early. You could save thousands or tens of thousands of dollars in interest payments. When you pay your mortgage early, those interest savings are a guaranteed return on your investment.
  • Peace of mind: If you don’t like the idea of constant debt, paying your mortgage early could ease your burden. If you experience a financial emergency, having a home that’s already paid off means you don’t have to worry about missing mortgage payments and potentially losing the home to foreclosure. You still will be responsible for property taxes as long as you own the home, but that’s a much smaller financial responsibility.
  • Build equity: Paying down your mortgage faster means building equity in your home more quickly. This can help you qualify for refinancing, which can save you even more money in the long run. You may also be able to leverage your equity in the form of a home equity loan or home equity line of credit (HELOC), which you can use to make improvements that increase your home’s value or pay off other higher-interest debt.

Drawbacks of Paying Off Your Mortgage Early

  • Opportunity cost: Any extra money you spend on paying down your mortgage faster is money you aren’t able to use for other financial goals. You may be paying off your mortgage early at the expense of your retirement savings, emergency fund or other higher return opportunities.
  • Wealth is tied up: Property is an illiquid asset, meaning you can’t convert it to cash quickly or easily. If you faced a financial emergency or had an investment opportunity you wanted to jump on, you’d not only have to sell your house, but also wait until a buyer was available and the sale closed.
  • Loss of some tax breaks: If you choose to pay down your mortgage instead of maxing out your tax-advantaged retirement accounts, you will give up those tax savings. Plus, you may lose out on tax deductions for mortgage interest if you normally itemize.

Benefits of Investing Your Extra Cash

  • Higher returns: The biggest benefit of investing your money instead of using it to pay down your mortgage faster is the return on investment. For many years, average stock market returns have been significantly higher than mortgage rates, which means you stand to gain quite a bit from the difference.
  • Liquid investment: Unlike a home that ties up your wealth, having your money in stocks, bonds and other market investment means you can easily sell and access your money if you need to.
  • Employer match: If you choose to invest your extra funds in a retirement account and your employer offers a match, that’s additional free money that you get to enjoy compound earnings on over time. You’d also be investing pre-tax dollars, which could help you afford larger contributions.

Drawbacks of Investing Your Extra Cash

  • Higher risk: There is more volatility in the stock market than in the housing market year over year, so you should be sure your investing timeline is long enough to weather ups and downs. You also need to make sure that your investment strategy matches your risk tolerance and you’re mentally prepared to take some hits.
  • Increased debt: Choosing to invest your money may not be the best option if you don’t like the idea of having debt to your name. Until your mortgage is repaid, you don’t actually own your home—the bank does. And there will always be some risk that you could lose your home if you aren’t able to make the payments.

Best of Both Worlds: Refinance and Invest

If you’re still on the fence about which option is best, you may not need to choose between paying your mortgage early and investing. Rather, you can take a two-pronged approach to reducing your debt and growing your wealth.

Mortgage rates are at historic lows, which means it’s a great time to refinance. If you took out your mortgage or last refinanced years ago, it’s likely that you can save quite a bit of money by refinancing to a lower interest rate and/or reducing your mortgage term length. That’s true whether or not you also choose to pay down the loan more aggressively. Just be sure to factor in closing costs when running the numbers.

With your newfound mortgage savings in place, you can go ahead and invest, too. This allows you to spend less on your mortgage overall while still taking advantage of the higher returns of the stock market.