Pay Off Mortgage vs Invest: The After-Tax Spread Framework
The math is simple — after-tax mortgage rate vs expected after-tax investment return. The execution is hard because the mortgage rate is risk-free and the investment return is not. The right answer depends on liquidity, term left, and bracket.
The mortgage-vs-invest debate gets argued like a religious question because most people frame it that way. One camp insists the guaranteed return on debt paydown beats the variable return on the market; the other insists the long-run S&P 500 return crushes any mortgage rate. Both are right partway and wrong partway. The actual answer is decided by a single arithmetic comparison —after-tax mortgage rate vs after-tax expected investment return— modified by three things the napkin version skips: liquidity, term remaining, and the certainty premium.
The framing matters because the dollar stakes are large. A $400,000 mortgage with 25 years left attracting an extra $500/month decision is, over the remaining life of the loan, roughly a $200K–$400K difference in net worth depending on which side you pick and how returns play out. That’s not a tie-breaker question; it’s the central asset-allocation decision for most US homeowner households between ages 30 and 60.
This guide walks through the after-tax spread framework, the post-TCJA mortgage-interest-deduction reality (most filers lost deductibility in 2018 and don’t realize it), the certainty premium that justifies a real haircut on the “expected return” side of the comparison, the term-remaining effect that makes year-1 prepayments very different from year-25 prepayments, and three worked examples covering the most common rate environments. Every dollar figure is reproducible in the pay-off mortgage vs invest calculator — the calculator runs both scenarios in parallel over your actual horizon and produces the after-tax breakeven rate that flips the answer.
The Popular-but-Wrong Framing
Most internet advice on this question collapses to one of two slogans. “Stocks return 10% a year, your mortgage is 4%, invest the difference.” Or, on the other side: “Pay off your mortgage, sleep peacefully, money in the market is gambling.” Both slogans take a hard problem and reduce it to a temperament question. Neither does the actual math.
Three structural failures in those slogans. First, nominal returns aren’t after-tax returns. The S&P 500’s long-run nominal return is roughly 10%; the after-inflation real return is roughly 7%; the after-tax (in a taxable account) real return for most middle-class US households is closer to 5.0–5.5%. The mortgage rate, conversely, is paid with after-tax dollars and not deductible for most filers post-TCJA, so the gross rate is the after-tax rate. Comparing 10% nominal market to 4% mortgage is a 6-point gap; comparing 5% after-tax market to 4% mortgage is a 1-point gap. The slogan exaggerates the spread by 5×.
Second, certainty has value. Paying down a 5% mortgage produces a guaranteed 5% after-tax return; investing in equities produces a probable 7% real return with material variance. For most utility curves, a guaranteed 5% is worth roughly the same as a probable 7% — the standard finance shorthand is that you should haircut equity expected returns by 1–2 percentage points to get a certainty-equivalent comparison against a risk-free debt-paydown move. This is the part the “invest the difference” crowd routinely skips.
Third, liquidity matters. Money paid into mortgage principal is locked into home equity, which can only be accessed through refinance or HELOC — both of which take weeks, cost money, and require employment + credit conditions that may not hold when you most need the cash. Money in a brokerage account is accessible in T+2 days at any market price. Two assets with the same expected return but different liquidity should not be priced the same; the mortgage-paydown side carries an illiquidity penalty that’s real even when it’s hard to quantify.
The After-Tax Spread Framework
Reduce the question to one number: after-tax investment expected return minus after-tax mortgage rate. Positive, invest. Negative, prepay. Close to zero, look at certainty + liquidity + behavioral factors. The framework is mechanical:
For most US households post-TCJA, the “deductible fraction” is zero (because the standard deduction $30,000 joint / $15,000 single beats the schedule-A itemization on most modest mortgages), which means the after-tax mortgage rate equals the gross rate. For the 10–15% of US filers who do itemize and clear the $750,000 mortgage-interest cap, the deductible fraction is a real adjustment. Either way, the calculation is mechanical once you know which group you’re in.
The investment-return side is where assumptions matter. Long-run S&P 500 nominal return averages 10%; subtract 3% inflation for real return ~7%; subtract effective tax on long-term capital gains + qualified dividends in a taxable account (~15–20% federal + state for most middle-class households) for after-tax real return of ~5.5–6%. In a tax-advantaged account (401(k), Roth, IRA) the after-tax return is the gross return because no tax is paid on gains — which is why “maximize tax-advantaged contributions before paying down mortgage” is almost always right.
The TCJA Mortgage Interest Deduction Reality
The Tax Cuts and Jobs Act of 2017 (effective 2018–2025, with most provisions extended through 2026 by subsequent legislation) materially changed the mortgage-interest-deduction math for most US homeowners. The two changes that matter:
- Standard deduction nearly doubled:$30,000 for joint filers in 2026, $15,000 for single, $22,500 for head of household. To benefit from itemizing mortgage interest, your combined Schedule A items (mortgage interest + state/local taxes capped at $10,000 + charitable contributions + medical above 7.5% AGI) must exceed the standard deduction. For most modest mortgages, they don’t.
- $750,000 mortgage cap: Mortgage interest is deductible only on the first $750,000 of mortgage principal for loans originated after December 15, 2017 ($1M for older loans grandfathered in). Principal above $750K produces non-deductible interest regardless of itemization status.
The practical implication: a household with a $400K mortgage at 6.5% pays roughly $26K of interest in year 1. Combined with $10K SALT + $5K charitable, total Schedule A = $41K. Above the $30K joint standard deduction, so itemizing makes sense and the first $11K of mortgage interest above the standard-deduction threshold is effectively deductible. At a 22% federal bracket, the deduction saves $2,420 of federal tax — an effective reduction in mortgage rate of $2,420 / $400,000 = 0.6 percentage points, taking the after-tax mortgage rate from 6.5% to roughly 5.9%.
Compare to a household with a $200K mortgage at 6.5%. Year 1 interest roughly $13K. Combined Schedule A = $13K + $10K SALT + $3K charitable = $26K, below the $30K standard deduction. This household gets zero benefitfrom itemizing — their after-tax mortgage rate equals their gross rate at 6.5%. Most modest US mortgages fall into this second bucket post-TCJA.
The deduction also decays as the loan amortizes. By year 15 of a 30-year $400K mortgage, annual interest has dropped to roughly $14K, which combined with the rest of Schedule A may no longer clear the standard deduction. The same household that benefits from itemizing in year 1 may lose that benefit in year 15, raising the effective after-tax mortgage rate over the life of the loan. The framework above should use a blended after-tax rate across the relevant horizon, not just the year-1 rate.
The Certainty Premium: Why a Guaranteed 5% Beats a Probable 7%
The math says invest if expected return exceeds debt cost. Real people prefer a guaranteed 5% to a probable 7% with variance, and their preference isn’t irrational — it falls out of any utility function with risk aversion (which describes essentially all of human economic behavior). The standard finance shorthand: equity expected returns should be haircut by 100–200 basis points when comparing to a risk-free guaranteed return for decision purposes.
The mechanism: a probable 7% with 15% standard deviation has real downside scenarios. A 30% drawdown in year 5 of a 30-year horizon is recoverable but unpleasant; a similar drawdown in year 25 (when the portfolio is large and the time-to-recovery is short) can be catastrophic. Mortgage paydown has no equivalent downside — the savings show up as compressed amortization and lower future interest, every month, every year, regardless of what happens to markets, employment, interest rates, or any other variable.
The certainty premium is most relevant for households within 10–15 years of retirement, where the time-to-recover from an equity drawdown is shrinking and the personal cost of market variance is rising. For a 35-year-old with 30 years of equity exposure ahead, the certainty premium is small — the long horizon naturally smooths variance, and the expected-return math dominates. For a 55-year-old with 10 years to retirement, the certainty premium is large enough that even a 1.5-point spread in favor of equities is no longer obviously the right call.
Practical haircut rule: subtract 100 bps from equity expected returns for households 20+ years from retirement, 150 bpsfor households 10–20 years from retirement, 200 bpsfor households within 10 years of retirement. After the haircut, compare directly to the after-tax mortgage rate. Positive spread → invest. Negative → prepay.
The Term-Remaining Effect
Extra payments are not equally powerful at every point in the loan life. The amortization schedule of a fixed-rate mortgage is front-loaded with interest — the first 10 years of a 30-year loan pay roughly 70% of the lifetime interest while reducing principal by only ~20%. The same is true in reverse for prepayments: a $1 of extra principal in year 1 of a 30-year loan removes 29 years of compounded future interest from the balance and saves roughly $5–$6 over the loan’s life. The same $1 in year 25 only has 5 years of remaining compounding to attack, saving roughly $0.30.
This means the prepay-vs-invest framing changes meaningfully based on where in the loan you are. A household with 25 years remaining on a 6.5% mortgage gets enormous leverage from extra principal — every $1 prepayment removes ~$5 of future interest, an effective guaranteed return well above the gross 6.5% rate when measured per dollar paid. A household with 5 years remaining on the same loan gets only ~$0.30 of future interest savings per $1 of extra principal, far below the rate they’d earn in even a HYSA.
For households with under 5–7 years left on the mortgage, the prepay vs invest debate is largely moot — the math heavily favors investing or even cash savings because extra prepayments produce minimal interest savings on the short residual loan. The framework above should be applied with the term-weighted effective return on prepayment, not just the headline mortgage rate. The loan EMI calculator models this directly — the extra-payment field reports both months saved and dollar interest saved, which lets you compute the actual leverage of any given prepayment in the current loan year.
Worked Example #1: 6.5% Mortgage, 25 Years Left
Set the table. $400,000 mortgage at 6.5% APR, 25 years remaining, monthly payment $2,705. Joint filers, $180K combined income, 22% federal marginal bracket. Itemizing because Schedule A roughly $42K clears the $30K standard deduction. State tax 5%. Extra $500/month decision: prepay or invest?
Step 1 — after-tax mortgage rate. Year-1 interest roughly $25,800; deductible portion above standard-deduction threshold ~$12K (the “marginal” deductible interest). Effective marginal deduction value at 22% federal + 5% state = 27% × $12K = $3,240 federal/state savings. Effective rate reduction = $3,240 / $400K = 0.81 percentage points. After-tax mortgage rate ≈5.7% in year 1, blending toward 6.5% as the loan amortizes and interest deductibility decays. Use a 6.0% blended figure across the 25-year horizon.
Step 2 — after-tax investment return. Long-run S&P nominal 10%; subtract 3% inflation = 7% real; subtract 18% blended effective tax on LTCG + qualified dividends in a taxable account = after-tax real ~5.7%. Add 3% inflation back for nominal comparison = after-tax nominal ~8.7%.
Step 3 — raw spread. After-tax investment 8.7% − blended after-tax mortgage 6.0% = +2.7 percentage points in favor of investing.
Step 4 — certainty haircut. Household is 25 years from retirement (roughly), so apply 100 bps haircut. Certainty-equivalent spread = +1.7 percentage points in favor of investing. Decision: invest, but it’s not a runaway — a 50/50 split between brokerage and prepayment is defensible if the household values certainty highly.
Quantify the difference. Over 25 years, $500/mo invested at 8.7% nominal returns grows to roughly $510,000 (after-tax in a taxable brokerage). The same $500/mo applied as extra mortgage principal saves the loan early (around year 19 instead of year 25) and saves roughly $165,000 in interest over the loan life. Net delta in favor of investing: roughly $345,000of additional terminal wealth. The spread isn’t small.
Worked Example #2: 7% Mortgage, 10 Years Left
Same $400K original mortgage, but now refinanced or originated more recently at 7.0%, with only 10 years remaining (paid down to ~$240K). Same household profile. Schedule A in year 1 of the remaining 10 years: interest ~$16K + SALT $10K + charitable $3K = $29K, just below the $30K standard deduction. No mortgage deduction benefitin this scenario — after-tax mortgage rate equals gross 7.0%.
Step 1 — after-tax mortgage rate: 7.0%.
Step 2 — after-tax investment return: 8.7% (same as Example #1).
Step 3 — raw spread: 8.7% − 7.0% = +1.7 percentage points in favor of investing.
Step 4 — certainty haircut. Household is closer to retirement in this scenario (10-year horizon, not 25). Apply 150 bps haircut. Certainty-equivalent spread = +0.2 percentage points— essentially a tie. Decision: prepay or split 50/50; the math doesn’t clearly favor either side.
The term-remaining effect cuts both ways here. Only 10 years left means each $1 of extra prepayment saves only ~$1.50–$2 of future interest (vs $5–$6 in the year-1 of a 30-year scenario). That’s lower leverage on the prepayment side. But the investment side also has a shorter horizon (10 years), reducing compounding meaningfully. Over a 10-year window, $500/mo invested at 8.7% returns ~$95K; $500/mo prepayment saves ~$25K of interest. The investment wins on terminal wealth ($95K vs $25K + freed cash flow), but the certainty value of debt-free at retirement is real and personal.
Worked Example #3: 4.5% Legacy Mortgage, 8 Years Left
The case where the math overwhelmingly favors investing. $250K original mortgage at 4.5% (locked in 2019–2021 era), now paid down to $80K with 8 years remaining. Same household profile, but Schedule A is now well below standard deduction — mortgage interest only ~$3K/yr, plus SALT $10K + charitable $3K = $16K, well below $30K. No deduction benefit.
Step 1 — after-tax mortgage rate: 4.5%.
Step 2 — after-tax investment return: 8.7% nominal. Even in a HYSA at 4.5%, you break even with the mortgage rate — in a brokerage account at 8.7% nominal, you lap it.
Step 3 — raw spread: +4.2 percentage points in favor of investing.
Step 4 — certainty haircut at 150 bps: certainty-equivalent spread = +2.7 percentage points. Decision: invest, no contest.
This is the “let inflation do the work” scenario. Households who locked in sub-5% mortgages during 2019–2021 have an asset on their balance sheet (the loan) that loses real value to inflation every year. The cheapest way to repay a 4.5% loan in a 3% inflation environment is to do it as slowly as the contract allows, deploying surplus cash into anything earning meaningfully more than 4.5%. The behavioral temptation to “just get rid of the debt” on a 4.5% mortgage is one of the most expensive temptations in personal finance.
Common Mistakes
Mistake.Treating mortgage interest as deductible when it isn’t. Post-TCJA, the standard deduction ($30K joint / $15K single in 2026) clears the Schedule A threshold for most modest mortgages. If you don’t itemize, your after- tax mortgage rate equals your gross rate — the deduction adjustment is zero. Verify by adding mortgage interest + capped SALT + charitable on a recent 1040 worksheet; if the total is under standard deduction, the deduction story is folklore for your household.
Mistake.Comparing nominal investment return to nominal mortgage rate without consistency. Use after-tax for both, nominal for both, and the same horizon for both. Mixing units (10% nominal pre-tax stock vs 4% nominal mortgage) systematically overstates the case for investing by 2–3 percentage points. The pay-off mortgage vs invest calculator does the unit conversion correctly.
Mistake.Ignoring the certainty premium. A guaranteed 5% from prepayment is genuinely worth more than a probable 7% from equities, especially for households near retirement where the time-to-recover from a drawdown is short. Apply 100–200 bps haircut to the equity expected return for decision purposes; if the certainty-equivalent spread is still positive, invest, but don’t pretend the variance doesn’t exist.
Mistake.Skipping the 401(k) match before prepaying. Employer match on retirement contributions is typically 50–100% instant return on contribution — vastly better than any mortgage prepayment math. Capture the full match first; only then evaluate the prepay-vs-invest question on the surplus above match. Skipping the match to prepay even a 7% mortgage is a multi-thousand-dollar self-inflicted wound per year.
Mistake.Treating the prepayment as illiquid in principle but spending the “invest the difference” money on lifestyle creep. The expected-return math on investing only works if you actually invest the surplus. If the realistic alternative to extra mortgage payments is “I’ll spend it on a nicer car,” the prepayment wins by default because it’s forced savings into a real asset. Be honest about which version of yourself you’re modeling. The budget calculator can help test whether the “invest the difference” story is realistic for your household’s actual cash flow discipline.
Run Your Own Numbers
The framework reduces to one sentence: compute the after-tax spread between expected investment return and mortgage rate, haircut by 100–200 bps for certainty, and let the sign of what’s left decide the direction. Plug your actual mortgage rate, current balance, years remaining, marginal tax bracket, expected investment return, and horizon into the pay-off mortgage vs invest calculator and the calculator runs both scenarios in parallel over your actual remaining loan years, returns the after-tax breakeven rate that flips the answer, and surfaces the risk asymmetry most blogs skip. The output isn’t a prescription — it’s the right artifact for the conversation with yourself (and possibly a fee-only fiduciary planner) about how your household should weight certainty against expected return.
For the prepayment-only side of the math — how many months and how many dollars a given extra payment saves on your specific loan — use the loan EMI calculator with the extra-payment field. For the projection side, the compound interest calculator models what that same dollar amount grows into at your expected investment return over your horizon. For the bigger picture — is the surplus dollar best deployed against mortgage, brokerage, 529 college savings, or HSA — the debt payoff calculator handles multi-debt prioritization and the retirement savings calculator models the long-horizon retirement bucket. The full toolkit lives on the finance calculators hub.