Skip to main content
HomeBlogHow to Calculate Your Mortgage Payment
MortgageHome BuyingPersonal FinanceAmortizationReal EstateCalculator

How to Calculate Your Mortgage Payment — The Complete Guide

Everything you need to know about mortgage payments — the amortization formula, fixed vs adjustable rates, the true cost of a 30-year loan, and how to save tens of thousands of dollars with smarter borrowing strategies.

14 min read
Updated 2025
Beginner & Advanced

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

Principal:The original loan amount — what you borrowed
Interest:The lender's fee for providing the loan, expressed as an annual percentage rate
Term:The repayment period — typically 15 or 30 years
Down Payment:The upfront cash you pay — typically 3%–20% of the purchase price
LTV Ratio:Loan-to-Value = loan amount ÷ property value × 100
PITI:Principal + Interest + Taxes + Insurance — the full monthly housing cost

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.

THE MORTGAGE PAYMENT FORMULA
M = P × [r(1+r)ⁿ] / [(1+r)ⁿ − 1]
M
Monthly payment
P
Loan principal
r
Monthly rate (annual ÷ 12)
n
Total payments (years × 12)

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.

MonthPaymentPrincipalInterestBalance
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.

Predictable payments — easy to budget
Protection if rates rise significantly
Best for long-term homeowners (7+ years)
Higher initial rate than ARM

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.

Lower initial rate — saves money short-term
Ideal if you plan to sell before adjustment
Rate caps limit maximum annual increase
Payment uncertainty after fixed period ends

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.

Metric15-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.

Down Payment
3%
$12,000
Loan Amount
$388,000
Monthly P&I
$2,581
PMI
$97–$291/mo
30yr Total
$929,160 + PMI
Down Payment
5%
$20,000
Loan Amount
$380,000
Monthly P&I
$2,528
PMI
$95–$285/mo
30yr Total
$910,080 + PMI
Down Payment
10%
$40,000
Loan Amount
$360,000
Monthly P&I
$2,395
PMI
$90–$270/mo
30yr Total
$862,200 + PMI
Down Payment
20%
$80,000
Loan Amount
$320,000
Monthly P&I
$2,129
PMI
None ✅
30yr Total
$766,440
Down Payment
25%
$100,000
Loan Amount
$300,000
Monthly P&I
$1,996
PMI
None ✅
30yr Total
$718,560

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.

EXTRA PAYMENT IMPACT — $320,000 @ 7%, 30-year
$0/mo30 years 0 months$446,490 interest
$100/mo27 years 5 months$395,820 interest$50,670 saved
$200/mo25 years 1 month$368,204 interest$78,286 saved
$500/mo20 years 11 months$273,940 interest$172,550 saved
$1,000/mo16 years 8 months$203,580 interest$242,910 saved

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.

Max PITI = Gross Monthly Income × 0.28

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.

Max Total Debt = Gross Monthly Income × 0.36

Example: $8,000/mo income → max total debt of $2,880/month

Annual SalaryMax 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 Calculator

Frequently 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.