Loan Payment Calculator Formula

Understand the math behind the loan payment calculator. Each variable explained with a worked example.

Formulas Used

Monthly Payment

monthly_payment = monthly_rate > 0 ? loan_amount * monthly_rate * pow(1 + monthly_rate, num_payments) / (pow(1 + monthly_rate, num_payments) - 1) : loan_amount / num_payments

Total Amount Paid

total_paid = monthly_payment * num_payments

Total Interest

total_interest = total_paid - loan_amount

Variables

VariableDescriptionDefault
loan_amountLoan Amount(USD)25000
annual_rateAnnual Interest Rate(%)7.5
loan_term_yearsLoan Term (Years)(years)5
monthly_rateDerived value= annual_rate / 12 / 100calculated
num_paymentsDerived value= loan_term_years * 12calculated

How It Works

How Loan Payments Are Calculated

A fixed-rate loan payment stays the same every month, but the split between principal and interest changes. In the first year of a 5-year auto loan, about 60% of each payment goes to interest. By year 4, that flips and most goes to principal. The formula handles this automatically.

The Formula

Payment = P * [r(1+r)^n] / [(1+r)^n - 1]

  • P = Amount borrowed
  • r = Monthly interest rate (APR / 12 / 100)
  • n = Number of payments (term in months)
  • This is the same amortization formula used for mortgages, auto loans, personal loans, and student loans.

    When to Use This

    Before signing any loan agreement. Plug in the amount, rate, and term to see what you'll actually pay per month. Then try different terms: a 48-month auto loan vs. 60-month vs. 72-month. The monthly payment drops with longer terms, but total interest paid goes up.

    What Changes the Payment Most

    Interest rate and loan term. On a $25,000 auto loan, the difference between 5% and 8% APR over 60 months is about $40/month, which adds up to $2,400 over the life of the loan. Shortening from 60 to 48 months increases your payment by roughly $100/month but saves over $1,000 in total interest.

    Common Mistakes

  • Confusing APR with the monthly rate. The formula needs the monthly rate, which is APR divided by 12 and then by 100.
  • Ignoring fees. Some lenders charge origination fees (1-5% of the loan) that effectively raise the cost beyond what the stated APR suggests.
  • Extending the loan term to get a lower payment without calculating total interest. A 72-month auto loan at 6% costs thousands more in interest than a 48-month loan at the same rate.
  • Worked Example

    You take out a $25,000 personal loan at 7.5% annual interest for 5 years.

    loan_amount = 25000annual_rate = 7.5loan_term_years = 5
    1. 01Monthly interest rate: 7.5% / 12 = 0.625% (0.00625)
    2. 02Total payments: 5 * 12 = 60
    3. 03Monthly Payment = $25,000 * [0.00625 * (1.00625)^60] / [(1.00625)^60 - 1]
    4. 04Monthly Payment = $500.57
    5. 05Total paid: $500.57 * 60 = $30,034.20
    6. 06Total interest: $30,034.20 - $25,000 = $5,034.20

    When to Use This Formula

    • Comparing auto loan offers from a dealership, bank, and credit union that each quote different rates and terms to find the cheapest total cost.
    • Planning a monthly budget before taking on a personal loan to make sure the payment fits comfortably within your income after other obligations.
    • Deciding between a shorter loan term with higher payments versus a longer term with lower payments, and quantifying how much extra interest the longer term costs.
    • Calculating how much you save in total interest by making extra principal payments each month or making one extra payment per year.
    • Evaluating whether consolidating multiple debts into a single loan at a lower rate actually reduces your total cost or just extends the timeline.
    • Building an amortization schedule to see exactly how much of each payment goes to principal versus interest at any point in the loan.

    Common Mistakes to Avoid

    • Using the annual rate instead of the periodic rate in the PMT formula — for monthly payments, divide the annual rate by 12; for biweekly payments, divide by 26.
    • Overlooking fees that effectively raise the cost of the loan — origination fees, closing costs, and prepayment penalties are not captured by the payment formula but significantly affect the true annual percentage rate (APR).
    • Assuming the first payment is entirely interest — even the first payment includes some principal, and the split shifts over time as the balance decreases, which is why early payoff saves much more interest than late payoff.
    • Entering the wrong number of periods — a 5-year loan with monthly payments has 60 periods, not 5, and getting this wrong produces a payment amount that is off by an order of magnitude.
    • Ignoring the difference between the stated interest rate and APR — the APR includes fees and compounding effects, making it the true comparison metric between loan offers.

    Frequently Asked Questions

    How do I calculate a loan payment?

    Use the amortization formula: M = P * [r(1+r)^n] / [(1+r)^n - 1]. Enter your loan amount, interest rate, and term into this calculator for instant results.

    What factors affect my loan payment?

    Three main factors: loan amount (higher = bigger payment), interest rate (higher = bigger payment), and loan term (longer = smaller payment but more total interest).

    Is a shorter or longer loan term better?

    Shorter terms have higher monthly payments but lower total interest. Longer terms have lower payments but cost more in total interest over the life of the loan.

    What is APR and how does it differ from the interest rate?

    The interest rate is the base cost of borrowing the principal. APR (Annual Percentage Rate) includes the interest rate plus fees such as origination fees and points, giving you the true annual cost of the loan. Always compare APRs when shopping for loans.

    Learn More

    Guide

    How to Calculate Loan Amortization

    Learn how loan amortization works, how to build an amortization schedule, and how extra payments accelerate your payoff. Covers mortgages, auto loans, and personal loans.

    Ready to run the numbers?

    Open Loan Payment Calculator