TL;DR — Quick Summary
- Mortgage payment = P × [r(1+r)ⁿ] / [(1+r)ⁿ − 1] where r = monthly rate and n = total payments
- On a 30-year $320,000 loan at 7%, you pay ~$446,000 in interest — 140% of the original loan
- A 15-year mortgage saves ~50% in total interest vs a 30-year but has ~50% higher monthly payment
- Extra payments early in the loan provide the highest return — they eliminate future compounding interest
- Use the QuickTextTools Mortgage Calculator for instant results with full amortization
What Is a Mortgage?
A mortgage is a loan specifically used to purchase real estate, where the property itself serves as collateral. If you stop making payments, the lender can take ownership of the property through a legal process called foreclosure. This security for the lender is what allows mortgage interest rates to be significantly lower than unsecured loans like personal loans or credit cards.
Unlike a simple loan where you borrow a lump sum and repay it in equal installments, a mortgage uses an amortizing repayment structure — the same monthly payment applies throughout the loan term, but the proportion going to interest vs. principal shifts every single month.
Key Mortgage Components
How Monthly Payment Is Calculated
The monthly mortgage payment for a fixed-rate loan is calculated using the standard loan amortization formula. This formula ensures that each of the n equal monthly payments fully retires the loan at the end of the term.
M = P × [r(1+r)ⁿ] / [(1+r)ⁿ − 1]
Worked Example
Home Price: $400,000 Down Payment: $80,000 (20%) Loan Amount: P = $320,000 Interest Rate: 7% annually → r = 0.07 / 12 = 0.005833 Loan Term: 30 years → n = 30 × 12 = 360 M = 320,000 × [0.005833 × (1.005833)^360] / [(1.005833)^360 − 1] M = 320,000 × [0.005833 × 8.1164] / [8.1164 − 1] M = 320,000 × 0.047337 / 7.1164 M = 320,000 × 0.006653 M = $2,128.96 per month
Over 360 payments of $2,128.96, you pay a total of $766,426 — of which $320,000 is the original loan and $446,426 is interest alone. This is the true cost of 30 years of borrowing at 7%.
Amortization Explained
Amortization is the process of spreading a loan into a series of fixed payments over time. The word comes from the Old French amortir — "to kill" — as you slowly "kill off" the debtwith each payment.
While your payment amount stays constant, the split between principal and interest changes with every single payment. This happens because interest is always calculated on the remaining balance — as the balance falls, the interest portion of each payment shrinks and the principal portion grows.
| Month | Payment | Principal | Interest | Balance |
|---|---|---|---|---|
| 1 | $2128.96 | $262.29 | $1866.67 | $319,737.71 |
| 2 | $2128.96 | $263.82 | $1865.14 | $319,473.89 |
| 3 | $2128.96 | $265.36 | $1863.60 | $319,208.53 |
| 12 | $2128.96 | $278.57 | $1850.39 | $316,815.19 |
| 120 | $2128.96 | $403.75 | $1725.21 | $295,637.82 |
| 180 | $2128.96 | $570.20 | $1558.76 | $266,736.45 |
| 240 | $2128.96 | $804.96 | $1324.00 | $226,040.58 |
| 300 | $2128.96 | $1136.45 | $992.51 | $169,358.72 |
| 359 | $2128.96 | $2104.38 | $24.58 | $2,104.38 |
| 360 | $2116.66 | $2104.38 | $12.28 | $0.00 |
Sample amortization — $320,000 loan at 7% over 30 years. Note how month 1 is 87.7% interest; month 360 is 99.4% principal.
Fixed vs Adjustable Rate Mortgages
Choosing between a fixed-rate and adjustable-rate mortgage (ARM) is one of the most consequential decisions in home buying. The right choice depends on how long you plan to stay in the home and your tolerance for payment uncertainty.
Fixed-Rate Mortgage
Your interest rate and monthly payment are locked for the entire loan term — 15, 20, or 30 years. No surprises, no resets, no market risk.
Adjustable-Rate Mortgage (ARM)
Rate is fixed for an initial period (typically 3, 5, 7, or 10 years) then adjusts annually based on a market index plus a fixed margin.
A 5/1 ARM has a fixed rate for the first 5 years, then adjusts annually. With caps of 2/2/5 (common), the rate can rise at most 2% in any single adjustment, 2% total in the first adjustment, and 5% above the initial rate over the life of the loan. In a rising rate environment, a 5/1 ARM starting at 5.5% could reach 10.5% after 5+ years.
15-Year vs 30-Year Mortgage
The choice between a 15-year and 30-year mortgage is the single decision that most dramatically affects your total mortgage cost. The numbers are stark.
| Metric | 15-Year @ 6.5% | 30-Year @ 7.0% |
|---|---|---|
| Loan Amount | $320,000 | $320,000 |
| Monthly Payment | $2,790 | $2,129 |
| Total Payments | $502,200 | $766,440 |
| Total Interest | $182,200 | $446,440 |
| Interest Savings | — | — |
| Equity at Year 5 | $102,400 | $24,200 |
| Equity at Year 10 | $221,500 | $53,700 |
The 30-Year Strategy — When It Makes Sense
The 30-year mortgage is not automatically the wrong choice. If your alternative uses of the payment difference (the ~$661/month gap) earn returns exceeding your mortgage interest rate — through 401(k) contributions, index fund investments, or paying off higher-interest debt — the 30-year loan can be the mathematically superior choice. The lower payment also provides a cash flow buffer for emergencies.
Down Payment Impact & PMI
Your down payment affects your mortgage in three key ways: it determines your loan amount (and therefore monthly payment), it determines whether you pay PMI, and it affects your loan-to-value ratio which influences your interest rate.
Based on $400,000 home, 7.0% interest rate, 30-year term. PMI estimated at 0.3%–0.9% annually.
The Power of Extra Payments
No investment strategy provides a more guaranteed return than paying down mortgage debt early. Every dollar of extra principal payment eliminates future interest that would have compounded at your mortgage rate — effectively earning a guaranteed, risk-free return equal to your interest rate.
An extra $200/month on a $320,000 mortgage saves over $78,000 in interest and pays the loan off nearly 5 years early. Use the mortgage calculator's extra payment field to model the exact savings for your loan.
How Much House Can You Afford?
Lenders use two key ratios to determine how much mortgage you can qualify for. Understanding these ratios helps you shop with realistic expectations.
Front-End Ratio (28% Rule)
Your monthly housing costs (PITI) should not exceed 28% of your gross monthly income.
Example: $8,000/mo income → max PITI of $2,240/month
Back-End Ratio (36% Rule)
All monthly debt payments (mortgage + car loans + student loans + credit cards) should not exceed 36% of gross income.
Example: $8,000/mo income → max total debt of $2,880/month
| Annual Salary | Max PITI (28%) | Approx Loan @ 7% | Home Price (20% DP) |
|---|---|---|---|
| $60,000 | $1,400/mo | $210,000 | $262,500 |
| $80,000 | $1,867/mo | $280,000 | $350,000 |
| $100,000 | $2,333/mo | $350,000 | $437,500 |
| $120,000 | $2,800/mo | $420,000 | $525,000 |
| $150,000 | $3,500/mo | $525,000 | $656,250 |
| $200,000 | $4,667/mo | $700,000 | $875,000 |
Calculate Mortgage Payment in Python
def calculate_mortgage(principal, annual_rate, years, extra_payment=0):
"""
Calculate fixed-rate mortgage payment and amortization schedule.
Args:
principal: Loan amount in dollars
annual_rate: Annual interest rate as percentage (e.g., 7.0 for 7%)
years: Loan term in years
extra_payment: Additional monthly principal payment
Returns:
dict with monthly_payment, total_payment, total_interest, schedule
"""
monthly_rate = annual_rate / 100 / 12
n_payments = years * 12
if monthly_rate == 0:
monthly_payment = principal / n_payments
else:
monthly_payment = principal * (
monthly_rate * (1 + monthly_rate) ** n_payments
) / ((1 + monthly_rate) ** n_payments - 1)
# Build amortization schedule
schedule = []
balance = principal
total_interest = 0
month = 0
while balance > 0.01 and month < n_payments:
month += 1
interest = balance * monthly_rate
principal_payment = min(monthly_payment - interest + extra_payment, balance)
total_interest += interest
balance = max(0, balance - principal_payment)
schedule.append({
'month': month,
'year': (month - 1) // 12 + 1,
'payment': monthly_payment + extra_payment,
'principal': principal_payment,
'interest': interest,
'balance': balance,
'total_interest_paid': total_interest,
})
total_payment = sum(row['payment'] for row in schedule)
return {
'monthly_payment': monthly_payment,
'total_payment': total_payment,
'total_interest': total_interest,
'actual_months': month,
'schedule': schedule,
}
# Example usage
result = calculate_mortgage(
principal=320_000,
annual_rate=7.0,
years=30,
extra_payment=200
)
print(f"Monthly Payment: $${result['monthly_payment']:,.2f}")
print(f"Total Payment: $${result['total_payment']:,.2f}")
print(f"Total Interest: $${result['total_interest']:,.2f}")
print(f"Payoff: ${result['actual_months']} months (${result['actual_months']/12:.1f} years)")
Save amortization to CSV
import csv
with open('amortization.csv', 'w', newline='') as f:
writer = csv.DictWriter(f, fieldnames=result['schedule'][0].keys())
writer.writeheader()
writer.writerows(result['schedule'])Calculate Mortgage Payment in JavaScript
function calculateMortgage(principal, annualRate, years, extraPayment = 0) {
const monthlyRate = annualRate / 100 / 12;
const nPayments = years * 12;
const monthlyPayment = monthlyRate === 0
? principal / nPayments
: principal * (monthlyRate * Math.pow(1 + monthlyRate, nPayments))
/ (Math.pow(1 + monthlyRate, nPayments) - 1);
const schedule = [];
let balance = principal;
let totalInterest = 0;
let month = 0;
while (balance > 0.01 && month < nPayments) {
month++;
const interest = balance * monthlyRate;
const principalPayment = Math.min(monthlyPayment - interest + extraPayment, balance);
totalInterest += interest;
balance = Math.max(0, balance - principalPayment);
schedule.push({
month,
year: Math.ceil(month / 12),
payment: monthlyPayment + extraPayment,
principal: principalPayment,
interest,
balance,
totalInterestPaid: totalInterest,
});
}
return {
monthlyPayment,
totalPayment: schedule.reduce((s, r) => s + r.payment, 0),
totalInterest,
actualMonths: month,
schedule,
};
}
// Example
const result = calculateMortgage(320000, 7.0, 30, 200);
console.log(`Monthly Payment: $${result.monthlyPayment.toFixed(2)}`);
console.log(`Total Interest: $${result.totalInterest.toFixed(2)}`);
console.log(`Payoff in: ${result.actualMonths} months`);Common Mortgage Mistakes to Avoid
✗Focusing only on the monthly payment, not total cost
A lower monthly payment achieved by extending the loan term or making a smaller down payment almost always costs significantly more in total interest over the life of the loan. Always calculate the total cost, not just the monthly payment.
✗Not getting pre-approved before house hunting
Pre-qualification is not the same as pre-approval. Without pre-approval, you risk falling in love with homes outside your budget, losing offers to pre-approved buyers, and wasting weeks in the buying process before discovering financing issues.
✗Opening new credit accounts before closing
Lenders pull your credit again shortly before closing. New accounts lower your average account age, increase your total credit utilization inquiry count, and can change your debt-to-income ratio — all of which can result in a higher rate, a smaller loan, or outright denial.
✗Underestimating total homeownership costs
Your mortgage payment is not your only housing cost. Budget an additional 1%–2% of the home's value per year for maintenance and repairs. Add property taxes, HOA fees if applicable, utilities, and any renovation costs to get your true monthly housing number.
✗Not comparing at least 3 lenders
Studies show that getting just one additional mortgage quote saves an average of $1,500 over the loan. Getting 5 quotes can save over $3,000. Rates and fees vary significantly between lenders for the same borrower profile — shopping takes 2 hours and is worth thousands.
Best Practices for Mortgage Borrowers
Keep your housing cost below 25% of take-home pay
While lenders allow up to 28% of gross income, using take-home pay as your benchmark is more conservative and better reflects your actual cash flow. This leaves sufficient room for retirement savings, emergency fund contributions, and lifestyle expenses.
Build a 6-month emergency fund before buying
Homeownership brings unexpected large expenses — HVAC failures, roof repairs, appliance replacements. Without an emergency fund, you risk missing mortgage payments and damaging your credit when these arise. A liquid cash reserve is non-negotiable.
Put down 20% if at all possible
The PMI savings alone — $100–$400/month on a typical mortgage — often justify waiting to accumulate a 20% down payment. You also immediately start with more equity, lower your monthly payment, and improve your negotiating position as a buyer.
Make extra payments in the first 10 years for maximum impact
Extra payments early in the loan eliminate future interest that would have compounded for decades. A $10,000 extra payment in year 2 saves far more than the same payment in year 25 — because it eliminates 23 more years of compounding interest.
Review your mortgage annually and refinance strategically
Set a calendar reminder to review your mortgage rate annually against current market rates. A rate that is 0.75%+ higher than current offerings may be worth refinancing if you plan to stay 3+ more years and your break-even period is within that window.
Calculate Your Mortgage Now — Free, Instant, No Login
Full amortization schedule, payment breakdown, extra payment analysis, and CSV download — all in your browser.
Open Mortgage CalculatorFrequently Asked Questions
Conclusion
A mortgage is likely the largest financial commitment you will make in your lifetime. Understanding how monthly payments are calculated, how amortization shifts the principal/interest balance over time, and how strategic decisions — down payment size, loan term, extra payments — dramatically change total cost gives you the knowledge to borrow smarter.
The numbers are unambiguous: a 30-year mortgage at 7% means paying 140% of the loan amount in interest alone. A 15-year mortgage cuts that nearly in half. Extra payments in the early years of a 30-year loan offer compounding savings that rival investment returns. And eliminating PMI through a 20% down payment saves thousands per year at zero risk.
Use the mortgage calculator, run the amortization scenarios, model the extra payment impact, and make your borrowing decision from a position of complete financial clarity.