A mortgage payment is calculated the same way as any amortizing loan: the payment is fixed for the life of the loan, but the split between interest and principal shifts every month as the balance shrinks.
P is the loan amount (home price minus down payment), r is the monthly interest rate (annual rate divided by 12), and n is the total number of monthly payments.
Where your money actually goes early on
On a 30-year loan, the first payment is overwhelmingly interest — often 70-80% of it — because interest is charged on the outstanding balance, which is largest at the very start. Only the remaining sliver reduces principal. This ratio flips gradually over the loan’s life; by the final years, almost the entire payment is principal. This is why paying off a mortgage early saves far more interest in year 3 than it does in year 28 — more principal is still outstanding.
Why the down payment threshold matters
Putting down less than 20% typically triggers private mortgage insurance (PMI), an extra monthly charge that protects the lender, not you, in case of default. It adds real cost — often 0.5-1.5% of the loan annually — without buying you any equity. It usually cancels automatically once your loan balance drops to 78% of the original home value, but the total amount paid in the meantime can be substantial on a large loan.
The 15-year versus 30-year trade-off
A shorter term carries a lower interest rate and eliminates decades of interest payments, but the monthly payment is meaningfully higher because the same principal is repaid over half the time. A $240,000 loan at 6.5% costs about $1,517 a month over 30 years (total interest around $306,000) versus about $2,090 a month over 15 years (total interest around $136,000) — roughly $170,000 saved in interest, at the cost of $573 more per month.
What this calculator leaves out
Real monthly housing costs usually include property tax and homeowners insurance bundled into the payment (often called PITI: principal, interest, tax, insurance), plus PMI if applicable, and possibly HOA fees. This calculator isolates principal and interest specifically, since tax rates and insurance costs vary enormously by location and are not part of the loan math itself.