Monthly Payment: $0.00
Total Paid: $0.00
Total Interest: $0.00
Amortization Schedule
Payment #
Payment Date
Starting Balance
Payment
Principal Paid
Interest Paid
Ending Balance
Understanding Loan Amortization
An amortization schedule is a table that breaks down the periodic payments on a loan (like a mortgage, car loan, or personal loan) into principal and interest components. For each payment, you can see how much goes towards reducing the loan's principal balance and how much covers the interest accrued since the last payment.
Amortization is crucial because it shows how a loan is paid down over time. Early payments on a typical amortizing loan consist of a larger portion of interest and a smaller portion of principal. As the loan matures, this ratio shifts, with more of your payment going towards principal and less towards interest. This is due to the interest being calculated on the remaining principal balance, which decreases with each principal payment.
How the Math Works
The calculation for a fixed-rate loan's periodic payment involves a standard formula derived from the present value of an annuity.
P = Principal Loan Amount
r = Periodic Interest Rate (Annual Rate / Number of Payments per Year)
n = Total Number of Payments (Loan Term in Years * Number of Payments per Year)
The formula for the periodic payment (M) is:
$M = P \frac{r(1+r)^n}{(1+r)^n – 1}$
Once the monthly payment (M) is determined, the amortization schedule is built iteratively:
Interest Paid for the Period: Starting Balance * r
Principal Paid for the Period: M – Interest Paid
Ending Balance: Starting Balance – Principal Paid
The Ending Balance of one period becomes the Starting Balance of the next.
Key Components of an Amortization Schedule:
Payment Number: The sequence of the payment (1st, 2nd, etc.).
Payment Date: When the payment is scheduled to occur.
Starting Balance: The amount owed before the payment is made.
Total Payment: The fixed amount paid each period (calculated above).
Principal Paid: The portion of the payment that reduces the loan balance.
Interest Paid: The portion of the payment that covers interest accrued.
Ending Balance: The amount owed after the payment is made.
Why Use an Amortization Calculator?
This calculator helps you:
Estimate your fixed monthly (or other periodic) payment for a given loan.
Understand how much of your total repayment will go towards interest versus principal over the life of the loan.
Visualize the loan payoff progress with a detailed amortization schedule.
Compare different loan scenarios by adjusting the principal, interest rate, and term.
Make informed financial decisions by knowing the full cost of borrowing.
function calculateLoan() {
var principal = parseFloat(document.getElementById("loanAmount").value);
var annualRate = parseFloat(document.getElementById("annualInterestRate").value);
var years = parseInt(document.getElementById("loanTermYears").value);
var frequency = parseInt(document.getElementById("paymentFrequency").value);
if (isNaN(principal) || principal <= 0) {
alert("Please enter a valid loan amount.");
return;
}
if (isNaN(annualRate) || annualRate < 0) {
alert("Please enter a valid annual interest rate.");
return;
}
if (isNaN(years) || years <= 0) {
alert("Please enter a valid loan term in years.");
return;
}
if (isNaN(frequency) || frequency 0) {
monthlyPayment = principal * (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
} else {
// If interest rate is 0, payment is just principal divided by number of payments
monthlyPayment = principal / numberOfPayments;
}
// Ensure monthlyPayment is a valid number and not infinite
if (!isFinite(monthlyPayment) || monthlyPayment < 0) {
monthlyPayment = 0; // Default to 0 if calculation fails
alert("Could not calculate monthly payment. Please check your inputs.");
}
var totalPaid = monthlyPayment * numberOfPayments;
var totalInterest = totalPaid – principal;
document.getElementById("monthlyPaymentResult").textContent = "$" + monthlyPayment.toFixed(2);
document.getElementById("totalPaidResult").textContent = "$" + totalPaid.toFixed(2);
document.getElementById("totalInterestResult").textContent = "$" + totalInterest.toFixed(2);
// Populate amortization schedule
var amortizationBody = document.getElementById("amortization-body");
amortizationBody.innerHTML = ""; // Clear previous schedule
var currentBalance = principal;
var startDate = new Date(); // Use today as a reference, but dates are just for illustration
for (var i = 0; i < numberOfPayments; i++) {
var interestPayment = currentBalance * monthlyRate;
var principalPayment = monthlyPayment – interestPayment;
// Adjust last payment to ensure balance is exactly zero
if (i === numberOfPayments – 1) {
principalPayment = currentBalance;
monthlyPayment = interestPayment + principalPayment; // Recalculate final payment amount
totalPaid = (principalPayment + interestPayment) + (monthlyPayment * i);
totalInterest = totalPaid – principal;
document.getElementById("monthlyPaymentResult").textContent = "$" + monthlyPayment.toFixed(2);
document.getElementById("totalPaidResult").textContent = "$" + totalPaid.toFixed(2);
document.getElementById("totalInterestResult").textContent = "$" + totalInterest.toFixed(2);
}
// Handle potential floating point inaccuracies that might leave a tiny balance
if (currentBalance – principalPayment < 0.01 && i === numberOfPayments – 1) {
principalPayment = currentBalance;
monthlyPayment = interestPayment + principalPayment;
totalPaid = (principalPayment + interestPayment) + (monthlyPayment * i);
totalInterest = totalPaid – principal;
document.getElementById("monthlyPaymentResult").textContent = "$" + monthlyPayment.toFixed(2);
document.getElementById("totalPaidResult").textContent = "$" + totalPaid.toFixed(2);
document.getElementById("totalInterestResult").textContent = "$" + totalInterest.toFixed(2);
}
var endingBalance = currentBalance – principalPayment;
// Ensure ending balance doesn't go negative due to rounding
if (endingBalance < 0 && i < numberOfPayments – 1) {
// This case should ideally not happen with correct calculations, but as a safeguard:
endingBalance = 0;
} else if (endingBalance < 0 && i === numberOfPayments – 1) {
endingBalance = 0;
}
var row = amortizationBody.insertRow();
var paymentNumCell = row.insertCell();
var dateCell = row.insertCell();
var startBalanceCell = row.insertCell();
var paymentCell = row.insertCell();
var principalCell = row.insertCell();
var interestCell = row.insertCell();
var endBalanceCell = row.insertCell();
paymentNumCell.textContent = (i + 1);
// Simple date calculation for illustration
var nextDate = new Date(startDate);
switch(frequency) {
case 12: // Monthly
nextDate.setMonth(startDate.getMonth() + (i + 1));
break;
case 24: // Bi-monthly
nextDate.setDate(startDate.getDate() + (365.25 / 24) * (i + 1)); // Approximate
break;
case 52: // Weekly
nextDate.setDate(startDate.getDate() + 7 * (i + 1));
break;
}
dateCell.textContent = nextDate.toISOString().slice(0, 10);
startBalanceCell.textContent = "$" + currentBalance.toFixed(2);
paymentCell.textContent = "$" + monthlyPayment.toFixed(2);
principalCell.textContent = "$" + principalPayment.toFixed(2);
interestCell.textContent = "$" + interestPayment.toFixed(2);
endBalanceCell.textContent = "$" + endingBalance.toFixed(2);
currentBalance = endingBalance;
}
}
// Initial calculation on page load
window.onload = calculateLoan;