Loan Amortization Calculator
Loan Details
Monthly Payment: —
Total Interest Paid: —
Total Amount Paid: —
Amortization Schedule
| Payment # |
Payment Amount |
Principal Paid |
Interest Paid |
Remaining Balance |
Understanding Loan Amortization
Loan amortization is the process of paying off a debt over time through regular payments.
Each payment you make on an amortizing loan is applied to both the interest accrued
and the principal balance. Initially, a larger portion of your payment goes towards
interest, and as the principal balance decreases, more of your payment is allocated to
paying down the principal.
This calculator helps you understand how your loan will be paid off.
By entering the principal loan amount, the annual interest rate, and the loan term in years,
you can see your estimated monthly payment, the total interest you'll pay over the life
of the loan, and a detailed breakdown of each payment in the amortization schedule.
Key terms:
- Principal: The original amount of money borrowed.
- Interest Rate: The percentage charged by the lender on the outstanding principal.
- Loan Term: The total duration over which the loan is to be repaid.
- Monthly Payment: The fixed amount paid each month, covering both principal and interest.
- Amortization Schedule: A table showing each payment, detailing how much goes to principal, how much goes to interest, and the remaining balance after each payment.
Use this calculator to plan your finances and understand the impact of different loan terms
and interest rates on your repayment journey.
function calculateAmortization() {
var principal = parseFloat(document.getElementById("principal").value);
var annualInterestRate = parseFloat(document.getElementById("interestRate").value);
var loanTerm = parseFloat(document.getElementById("loanTerm").value);
var monthlyInterestRate = annualInterestRate / 12 / 100;
var numberOfPayments = loanTerm * 12;
var monthlyPayment = 0;
var totalInterestPaid = 0;
var totalAmountPaid = 0;
// Check for valid inputs
if (isNaN(principal) || principal <= 0 || isNaN(annualInterestRate) || annualInterestRate < 0 || isNaN(loanTerm) || loanTerm 0) {
monthlyPayment = principal * (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments)) / (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1);
} else { // Handle 0% interest rate
monthlyPayment = principal / numberOfPayments;
}
// Format monthly payment to two decimal places
monthlyPayment = monthlyPayment.toFixed(2);
document.getElementById("monthlyPayment").textContent = "$" + monthlyPayment;
var remainingBalance = principal;
var tableBody = document.getElementById("amortizationTable").getElementsByTagName('tbody')[0];
tableBody.innerHTML = "; // Clear previous results
for (var i = 1; i <= numberOfPayments; i++) {
var interestPayment = remainingBalance * monthlyInterestRate;
var principalPayment = monthlyPayment – interestPayment;
// Adjust for the last payment to account for rounding and ensure the balance is exactly zero
if (i === numberOfPayments) {
principalPayment = remainingBalance;
monthlyPayment = parseFloat(monthlyPayment) + (remainingBalance – principalPayment); // Add any difference to the last payment amount
monthlyPayment = monthlyPayment.toFixed(2);
}
remainingBalance -= principalPayment;
if (remainingBalance < 0) remainingBalance = 0; // Ensure balance doesn't go negative due to rounding
totalInterestPaid += interestPayment;
totalAmountPaid = principal + totalInterestPaid;
var row = tableBody.insertRow();
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
var cell4 = row.insertCell(3);
var cell5 = row.insertCell(4);
cell1.textContent = i;
cell2.textContent = "$" + parseFloat(monthlyPayment).toFixed(2);
cell3.textContent = "$" + principalPayment.toFixed(2);
cell4.textContent = "$" + interestPayment.toFixed(2);
cell5.textContent = "$" + remainingBalance.toFixed(2);
}
document.getElementById("totalInterest").textContent = "$" + totalInterestPaid.toFixed(2);
document.getElementById("totalAmountPaid").textContent = "$" + (principal + totalInterestPaid).toFixed(2);
}