Should You Pay Off Debt or Invest?
A practical framework for deciding when to prioritize paying off debt and when to invest — considering interest rates, tax advantages, and opportunity cost.
It's one of the most common financial dilemmas: you have extra cash each month. Should you use it to pay off your student loans faster, or invest it in the stock market? Pay down the mortgage, or fund a brokerage account? Eliminate the car payment, or start dollar-cost averaging into quality stocks?
The internet is full of confident advice in both directions. "Always pay off debt first" says one camp. "Always invest — the market returns more than your interest rate" says the other. Both camps are wrong, because the right answer depends on factors specific to your situation: the interest rate on your debt, your tax situation, your risk tolerance, and your psychological relationship with debt.
The Math: Interest Rate vs. Expected Return
The mathematical framework is straightforward. If your debt costs more than your investments are expected to return, pay off the debt. If your investments are expected to return more than your debt costs, invest.
Credit card debt at 20-25% APR should almost always be paid off before investing. No investment strategy reliably returns 20%+ annually. Paying off a 22% credit card is the equivalent of earning a guaranteed 22% return — risk-free, tax-free. There is no investment on earth that offers that combination.
On the other end, a 3% mortgage in a world where the stock market has historically returned 10% suggests investing is the better mathematical choice. The expected spread between your investment return and your debt cost is roughly 7% per year — a significant difference that compounds over the decades remaining on a mortgage.
The gray zone — debt at 5-8% — is where the decision gets genuinely difficult. The stock market's long-term average return exceeds this range, but the "average" masks enormous variation. In any given year, stocks might return 25% or decline 30%. The debt payment is a guaranteed return; the investment return is uncertain. How you weigh certainty against expected value depends on your personal circumstances and temperament.
What the Math Misses
Tax advantages change the calculation significantly. If your employer matches 401(k) contributions, investing enough to capture the full match comes first — always, regardless of debt. A 100% employer match is an immediate, guaranteed 100% return that no debt payoff can match. Even a 50% match is a guaranteed 50% return. Never leave this money on the table.
The tax deductibility of mortgage interest and student loan interest reduces the effective interest rate. A 6% mortgage for someone in the 24% tax bracket effectively costs about 4.6% after the deduction. This lower effective rate tilts the math toward investing.
Conversely, capital gains taxes on your investment returns reduce their effective yield. A 10% gross return at a 15% capital gains rate nets 8.5%. Tax-advantaged accounts like Roth IRAs and 401(k)s eliminate this drag, making investing more attractive than the pre-tax comparison suggests.
The Psychological Factor
The math matters, but so does your psychology. If carrying debt keeps you up at night, the peace of mind from paying it off has real value that no spreadsheet captures. A mathematically optimal strategy that you can't stick with is worse than a slightly suboptimal strategy you execute consistently.
Some people find debt motivating — it creates urgency and focus. Others find it paralyzing — it creates anxiety that bleeds into other decisions. Know yourself. If the psychological burden of debt prevents you from thinking clearly about investing, paying it off first may be the better choice even if the math says otherwise.
A Practical Framework
Start with the employer match. If your employer matches retirement contributions, invest enough to capture the full match before directing any extra money toward debt. This is free money.
Eliminate high-interest debt next. Any debt above 8-10% — credit cards, personal loans, payday loans — should be paid off aggressively before additional investing. The guaranteed "return" exceeds what you can reliably earn in the market.
Build a minimal emergency fund. Three months of expenses in liquid savings prevents you from needing to take on new debt when unexpected costs arise, which would undo your progress in either direction.
For moderate-rate debt (4-8%), consider splitting. Direct half of your available cash toward debt payoff and half toward investments in a tax-efficient account. This captures some of the mathematical advantage of investing while making steady progress on the debt. Adjust the split based on your comfort level.
For low-rate debt (below 4%), the math strongly favors investing — especially in tax-advantaged accounts. Make minimum payments on the debt and direct extra cash toward building a portfolio of quality investments that will compound over decades.
Related Posts
See these ideas in action
MoatScope uses the same frameworks you just read about — moat analysis, quality scores, and fair value estimates — across 2,600+ stocks.
Open MoatScope — Free