Owning a home outright is a dream that many Americans share. Having a mortgage can be a huge burden, and paying it off may be the first item on your financial to-do list. But competing with the desire to own your home free and clear is your need to invest for retirement, your child’s college education, or some other goal. Putting extra cash toward one of these goals may mean sacrificing another. So how do you choose?

Evaluating the opportunity cost

Deciding between prepaying your mortgage and investing your extra cash isn’t easy, because each option has advantages and disadvantages. But you can start by weighing what you’ll gain financially by choosing one option against what you’ll give up. In economic terms, this is known as evaluating the opportunity cost.

Here’s an example. Let’s assume that you have a $300,000 balance and 20 years remaining on your 30-year mortgage, and you’re paying 6.25% interest. If you were to put an extra $400 toward your mortgage each month, you would save approximately $62,000 in interest, and pay off your loan almost 6 years early.

By making extra payments and saving all of that interest, you’ll clearly be gaining a lot of financial ground. But before you opt to prepay your mortgage, you still have to consider what you might be giving up by doing so–the opportunity to potentially profit even more from investing.

To determine if you would come out ahead if you invested your extra cash, start by looking at the after-tax rate of return you can expect from prepaying your mortgage. This is generally less than the interest rate you’re paying on your mortgage, once you take into account any tax deduction you receive for mortgage interest. Once you’ve calculated that figure, compare it to the after-tax return you could receive by investing your extra cash.

For example, the after-tax cost of a 6.25% mortgage would be approximately 4.5% if you were in the 28% tax bracket and were able to deduct mortgage interest on your federal income tax return (the after-tax cost might be even lower if you were also able to deduct mortgage interest on your state income tax return). Could you receive a higher after-tax rate of return if you invested your money instead of prepaying your mortgage?

Keep in mind that the rate of return you’ll receive is directly related to the investments you choose. All investing involves risk, including the possible loss of principal, and there can be no assurance that any investment strategy will be successful. Investments with the potential for higher returns may expose you to more risk, so take this into account when making your decision.