Free backtest
Pay off the mortgage, or invest?
The odds investing wins, at every rate and term, against every real starting year since 1928.
Years. A longer term has more time in the market.
On top of your regular payment. Prepay it or invest it.
The rest is in bonds.
More options
Taken off every year's return. 0% is the pure comparison.
Odds investing wins, at every rate
Same loan, same term, same extra cash. Only the mortgage rate changes.
Click a bar to try that rate.
Same rate, different term
Every starting year
Hover any year; click one to replay it below. Grey = the term isn't over yet, so it isn't counted.
Net worth = investment account minus what you still owe. Both start at minus the loan. Hover for any month; click a legend name to hide a line.
Every rate, every starting year
The whole picture in one grid. Green: investing finished ahead. Red: paying off won.
Hover any square for its result; click to use that rate and replay that year.
Adjusted for your risk tolerance
Investing can win on average and still hurt in a bad stretch. Tell us how much that matters to you.
What investing is worth, at every rate
From your pay to your split
A common rule of thumb is to invest about 15% of your income and put the rest on the mortgage. It is a sensible default, but it is the same for everyone. Enter your pay, and your risk score turns the money you set aside (“Extra per month” above) into your own percentages of pay.
How this is calculated
Two people, same loan, same cash. Both borrow the mortgage amount at the same rate and term and both spend the regular payment plus the extra amount every month. The prepayer sends the extra to the mortgage, so the loan is gone years early, and from that month invests the whole freed-up payment until the original term ends. The investor pays the regular payment only and invests the extra every month. At the end of the term both own the home outright, so the only difference is the size of the investment account. That is what is compared.
Real history. Each starting year is tested with that year's actual stock and bond returns, one after the other (S&P 500 total return and an intermediate government bond proxy, NYU Stern / Damodaran). A year's return is spread evenly over its 12 months. A start year whose term isn't over yet is left out and shown grey, never guessed. Years overlap heavily (a 1990 start and a 1991 start share 29 years), so 69 windows of a 30-year term are far fewer independent experiences than the count suggests. Treat the odds as a guide, not a guarantee.
What it leaves out. Taxes, the mortgage interest deduction, fees (use the slider), property taxes and insurance (the same for both), a rate that changes, and what you would do in a panic. Investing is not guaranteed; paying off a mortgage is a guaranteed return equal to its rate.
Risk tolerance. Prepaying is the sure thing; investing is the gamble. For every starting year the gamble's result is the gap between the two accounts at the end of the term, measured as a share of all the extra money you put in. Your score sets how heavily the bad gaps weigh against the good ones (risk aversion = 2 × (10 − score)), and the whole range of historical gaps is boiled down to one number, its certainty equivalent: the sure gain that would feel as good as the uncertain one. A score of 10 judges by the plain average. The split shown is the mix of prepaying and investing with the best certainty equivalent for that score, and the break-even rate is the mortgage rate above which prepaying comes out better for you. It is a way to think, not a prescription.
Inflation. The yearly CPI series is part of the data, and every dollar amount can be shown in the money of the day the mortgage began. Inflation does not change who wins, because both sides of the comparison are in nominal terms: the stock returns are nominal and so is the mortgage rate. A nominal rate and the same rate after inflation are two names for one number, so the small italic figures under the rates in the odds chart show each rate after inflation. Over 1928–2025 the S&P 500 returned about 10.0% a year, or about 6.8% after inflation (3.0% a year on average), and the bars cross 50% near a 10% mortgage, which is about 6.8% in real terms. The odds were also recomputed a second way, with everything converted to real dollars month by month, and came out identical.
Your split in percent of pay. The split is for the extra money above: your risk score picks the share that goes on the mortgage, and the dollars are shown as a percentage of the after-tax pay you enter. It only divides that extra; your retirement contributions are separate. A common guideline (for example from Fidelity) is to save about 15% of pre-tax income for retirement, including any employer match.
Mortgage rates are Freddie Mac's weekly survey (via FRED), averaged by calendar year. Today's figure shown is the most recent weekly reading in the data.
Now the other half of the plan.
How many years until you can stop working?
One person's backtest, for education. Not personalized financial advice. Past performance does not guarantee future results.