Calculate your loan's amortization schedule and see how payments are applied to principal and interest over time.
Amortization Schedule
Payment #
Payment Date
Starting Balance
Payment
Interest Paid
Principal Paid
Ending Balance
Total Paid:
Understanding Loan Amortization
An amortization schedule is a table that details each periodic payment on an amortizing loan (like a mortgage, car loan, or personal loan). For each payment, it shows how much of the payment goes towards interest and how much goes towards the principal loan amount, as well as the remaining balance after each payment.
How Amortization Works
Amortization is the process of paying off debt over time through regular payments. Each payment is typically fixed, but the allocation of that payment between interest and principal changes with each period. Initially, a larger portion of your payment goes towards interest, and a smaller portion goes towards the principal. As you continue to make payments, the principal balance decreases, and consequently, the interest charged on that balance also decreases. This means a larger portion of your subsequent payments will go towards reducing the principal.
The Math Behind the Schedule
The calculation involves several steps:
Monthly Interest Rate: The annual interest rate is divided by 12.
Monthly Interest Rate = Annual Interest Rate / 12
Total Number of Payments: The loan term in years is multiplied by 12.
Total Payments = Loan Term (Years) * 12
Monthly Payment Calculation: The standard formula for calculating the fixed monthly payment (M) of an amortizing loan is:
M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1] Where:
P = Principal Loan Amount
i = Monthly Interest Rate
n = Total Number of Payments
Amortization Schedule Generation: For each payment period:
Interest Paid: Calculated on the outstanding balance from the previous period.
Interest Paid = Outstanding Balance * Monthly Interest Rate
Principal Paid: The difference between the total monthly payment and the interest paid for that period.
Principal Paid = Monthly Payment - Interest Paid
Ending Balance: The outstanding balance from the previous period minus the principal paid in the current period.
Ending Balance = Starting Balance - Principal Paid
The Ending Balance of one period becomes the Starting Balance for the next.
Use Cases and Benefits
Financial Planning: Understand the total cost of a loan over its lifetime, including the total interest paid.
Budgeting: Accurately forecast monthly expenses and how they change over time.
Loan Comparison: Evaluate different loan offers by comparing their amortization schedules and total interest costs.
Mortgage Prepayment Strategy: Identify how extra payments can accelerate principal reduction and save on interest.
Tax Deductions: For loans like mortgages, the interest paid is often tax-deductible. An amortization schedule helps track this amount.
Using an amortization schedule calculator like this one provides clarity and transparency, empowering you to make informed financial decisions.
function calculateAmortization() {
var loanAmount = parseFloat(document.getElementById('loanAmount').value);
var annualInterestRate = parseFloat(document.getElementById('annualInterestRate').value);
var loanTermYears = parseInt(document.getElementById('loanTermYears').value);
var errorMessageDiv = document.getElementById('errorMessage');
var tableBody = document.getElementById('amortizationTable').getElementsByTagName('tbody')[0];
var totalPaymentDisplay = document.getElementById('totalPayment');
var totalInterestDisplay = document.getElementById('totalInterest');
var totalPrincipalDisplay = document.getElementById('totalPrincipal');
// Clear previous results and error messages
tableBody.innerHTML = ";
errorMessageDiv.textContent = ";
totalPaymentDisplay.textContent = ";
totalInterestDisplay.textContent = ";
totalPrincipalDisplay.textContent = ";
// Input validation
if (isNaN(loanAmount) || loanAmount <= 0) {
errorMessageDiv.textContent = 'Please enter a valid loan amount greater than zero.';
return;
}
if (isNaN(annualInterestRate) || annualInterestRate < 0) {
errorMessageDiv.textContent = 'Please enter a valid annual interest rate (0% or greater).';
return;
}
if (isNaN(loanTermYears) || loanTermYears 0.01) { // Use a small threshold to account for rounding
var interestPayment = currentBalance * monthlyInterestRate;
var principalPayment = monthlyPayment – interestPayment;
// Adjust the last payment to ensure the balance reaches exactly zero
if (principalPayment > currentBalance) {
principalPayment = currentBalance;
monthlyPayment = interestPayment + principalPayment; // Recalculate last payment
}
var endingBalance = currentBalance – principalPayment;
// Ensure ending balance doesn't go negative due to floating point inaccuracies
if (endingBalance < 0) {
endingBalance = 0;
}
// Format date for display (e.g., MM/YYYY)
var month = currentDate.getMonth() + 1; // Months are 0-indexed
var year = currentDate.getFullYear();
var formattedDate = (month < 10 ? '0' : '') + month + '/' + year;
// Add row to table
var newRow = tableBody.insertRow();
newRow.insertCell(0).textContent = paymentCounter;
newRow.insertCell(1).textContent = formattedDate;
newRow.insertCell(2).textContent = '$' + currentBalance.toFixed(2);
newRow.insertCell(3).textContent = '$' + monthlyPayment.toFixed(2);
newRow.insertCell(4).textContent = '$' + interestPayment.toFixed(2);
newRow.insertCell(5).textContent = '$' + principalPayment.toFixed(2);
newRow.insertCell(6).textContent = '$' + endingBalance.toFixed(2);
totalInterestPaid += interestPayment;
totalPrincipalPaid += principalPayment;
currentBalance = endingBalance;
paymentCounter++;
currentDate.setMonth(currentDate.getMonth() + 1); // Move to the next month
}
// Update total displays
totalPaymentDisplay.textContent = '$' + (totalInterestPaid + totalPrincipalPaid).toFixed(2);
totalInterestDisplay.textContent = '$' + totalInterestPaid.toFixed(2);
totalPrincipalDisplay.textContent = '$' + totalPrincipalPaid.toFixed(2);
// Adjust the last payment row if it was modified due to rounding
if (paymentCounter -1 === numberOfPayments && Math.abs(currentBalance) < 0.01) {
var lastRow = tableBody.rows[tableBody.rows.length – 1];
var lastPaymentCell = lastRow.cells[3];
var lastInterestCell = lastRow.cells[4];
var lastPrincipalCell = lastRow.cells[5];
var lastEndingBalanceCell = lastRow.cells[6];
var finalMonthlyPayment = parseFloat(lastPaymentCell.textContent.replace('$', ''));
var finalInterestPayment = parseFloat(lastInterestCell.textContent.replace('$', ''));
var finalPrincipalPayment = finalMonthlyPayment – finalInterestPayment;
// Re-adjust the final payment to ensure exact principal payoff
var actualPrincipalPaidInLastRow = parseFloat(lastPrincipalCell.textContent.replace('$', ''));
var actualInterestPaidInLastRow = parseFloat(lastInterestCell.textContent.replace('$', ''));
var actualEndingBalance = parseFloat(lastEndingBalanceCell.textContent.replace('$', ''));
lastPrincipalCell.textContent = '$' + actualPrincipalPaidInLastRow.toFixed(2);
lastInterestCell.textContent = '$' + actualInterestPaidInLastRow.toFixed(2);
lastEndingBalanceCell.textContent = '$' + actualEndingBalance.toFixed(2);
}
// Make the table visible if it was hidden or empty
document.getElementById('amortizationTable').style.display = 'table';
}