Mortgages use amortization: each monthly payment is split between interest (a fee on the remaining balance) and principal (a reduction of the balance). Early in the loan, most of each payment is interest. Late in the loan, most is principal. Extra payments accelerate you into the "mostly principal" zone faster, which is why the savings compound so dramatically.
The formula
We simulate the loan month by month. For each month: (1) add interest = balance × (rate ÷ 12); (2) subtract the required payment + any extra; (3) repeat until balance reaches zero. The "interest saved" is the difference between total interest paid with and without extras.
When NOT to pay extra
Three situations argue against early payoff: (1) If your mortgage rate is below 4% and you can earn 7%+ in a diversified index fund, the math favors investing the extra cash. (2) If you have not maxed tax-advantaged accounts (401k match, HSA, IRA), do those first — they are free money. (3) If you have higher-interest debt (credit cards, student loans above 6%), pay those first. Always.
Liquidity warning
Money paid into your mortgage is locked up — you can only get it back by selling or refinancing. Keep an emergency fund of 3-6 months expenses in cash before paying extra on the mortgage. A paid-off house does not help if you lose your job and cannot buy groceries.