Should I pay off debt or invest?

Paying debt is a guaranteed return equal to the interest rate. Investing is an expected (uncertain) return. The simple rule: financial cost of debt beats expected market return → pay the debt. This tool quantifies the rule.

Effective debt cost
After-tax market return
The math says
Return gap
The decision rule If effective debt cost > after-tax expected return → pay the debt (guaranteed win). If the market's expected return clearly exceeds the debt cost → invest. Around the break-even, consider psychology: being debt-free is worth a small expected cost for many.
Why adjust for taxes? Investment gains are usually taxable; your market return needs to be net of that to compare fairly against debt, which you also pay from after-tax money. Mortgage interest tax-deduction reduces the real debt cost.
The numbers Effective APR = APR × (1 − deductible). After-tax return = market × (1 − tax). A $20,000 credit card at 24% vs a 7% expected market return is a 17-point gap → pay it off first, always.