Mortgage Calculator Amortization Graph

Mortgage Amortization Calculator body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; color: #333; background-color: #f4f7f6; margin: 0; padding: 20px; } .loan-calc-container { max-width: 900px; margin: 30px auto; background-color: #ffffff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); border: 1px solid #e0e0e0; } h1, h2 { color: #004a99; text-align: center; margin-bottom: 20px; } .input-group { margin-bottom: 20px; padding: 15px; background-color: #f8f9fa; border-radius: 5px; border: 1px solid #dee2e6; display: flex; flex-wrap: wrap; align-items: center; } .input-group label { flex: 1 1 150px; margin-right: 10px; font-weight: bold; color: #004a99; } .input-group input[type="number"], .input-group input[type="text"], .input-group select { flex: 1 1 200px; padding: 10px; border: 1px solid #ced4da; border-radius: 4px; font-size: 1rem; box-sizing: border-box; /* Important for padding and border */ } button { display: block; width: 100%; padding: 12px 20px; background-color: #004a99; color: white; border: none; border-radius: 5px; font-size: 1.1rem; cursor: pointer; transition: background-color 0.3s ease; margin-top: 10px; } button:hover { background-color: #003366; } #result { margin-top: 30px; padding: 20px; background-color: #e9ecef; border-radius: 5px; border: 1px solid #adb5bd; } #result h3 { color: #004a99; text-align: left; margin-bottom: 15px; } .result-section { margin-bottom: 15px; } .result-label { font-weight: bold; color: #333; display: inline-block; min-width: 180px; } .result-value { color: #004a99; font-size: 1.2rem; } .highlight-result { font-size: 1.5rem; font-weight: bold; color: #28a745; } .amortization-table { margin-top: 30px; overflow-x: auto; } .amortization-table table { width: 100%; border-collapse: collapse; margin-bottom: 20px; } .amortization-table th, .amortization-table td { border: 1px solid #dee2e6; padding: 10px; text-align: right; } .amortization-table th { background-color: #004a99; color: white; position: sticky; top: 0; } .amortization-table tr:nth-child(even) { background-color: #f8f9fa; } .amortization-table td:first-child, .amortization-table th:first-child { text-align: left; } .error-message { color: #dc3545; font-weight: bold; text-align: center; margin-top: 15px; } .article-section { margin-top: 40px; padding: 25px; background-color: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); border: 1px solid #e0e0e0; } .article-section h2 { text-align: left; margin-bottom: 15px; } .article-section h3 { color: #004a99; margin-top: 20px; margin-bottom: 10px; text-align: left; } .article-section p { margin-bottom: 15px; color: #555; } .article-section ul { margin-left: 20px; margin-bottom: 15px; } .article-section li { margin-bottom: 8px; } .formula { background-color: #e9ecef; padding: 15px; border-radius: 5px; margin-bottom: 15px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; white-space: pre-wrap; word-break: break-all; } @media (max-width: 768px) { .input-group { flex-direction: column; align-items: flex-start; } .input-group label { margin-bottom: 10px; margin-right: 0; } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: 100%; flex-basis: auto; } .result-label { min-width: auto; display: block; margin-bottom: 5px; } }

Mortgage Amortization Calculator

Monthly Payment:
Total Principal Paid:
Total Interest Paid:
Total Cost of Loan:

Amortization Schedule

Payment # Payment Date Starting Balance Monthly Payment Principal Paid Interest Paid Ending Balance

Understanding Mortgage Amortization

A mortgage is a significant financial commitment, and understanding how your loan is repaid over time is crucial. This is where mortgage amortization comes into play. An amortization schedule breaks down each payment into principal and interest components, showing how your loan balance decreases with each payment.

What is an Amortization Schedule?

An amortization schedule is a table that details the payments made on a loan over its entire term. For each payment, it shows:

  • Payment Number: The sequential number of the payment.
  • Payment Date: The scheduled date of the payment.
  • Starting Balance: The outstanding loan balance at the beginning of the payment period.
  • Monthly Payment: The fixed amount paid each month (principal + interest).
  • Principal Paid: The portion of the payment that reduces the actual loan amount borrowed.
  • Interest Paid: The portion of the payment that covers the cost of borrowing (interest).
  • Ending Balance: The loan balance remaining after the payment is applied.

How Mortgage Amortization Works (The Math)

The core of mortgage amortization lies in calculating the fixed monthly payment and then determining how much of that payment goes towards principal and interest for each period. The formulas used are:

1. Monthly Interest Rate:

Monthly Interest Rate = (Annual Interest Rate / 100) / 12

2. Number of Payments:

Number of Payments = Loan Term (in Years) * 12

3. Monthly Payment Calculation (M):

The standard formula for calculating the fixed monthly payment (M) for an amortizing loan is derived from the present value of an annuity formula:

M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]

Where:

  • P = Principal Loan Amount
  • i = Monthly Interest Rate (calculated above)
  • n = Total Number of Payments (calculated above)

4. Principal and Interest Allocation Per Payment:

For each payment period:

  • Interest Paid = Starting Balance * Monthly Interest Rate
  • Principal Paid = Monthly Payment – Interest Paid
  • Ending Balance = Starting Balance – Principal Paid

As the loan progresses, the starting balance decreases, meaning more of the fixed monthly payment is allocated to principal and less to interest, while the total monthly payment remains constant.

Key Takeaways from an Amortization Schedule:

  • Early Years: A larger portion of your payment goes towards interest.
  • Later Years: A larger portion of your payment goes towards principal.
  • Equity Building: As principal is paid down, your equity in the property increases.
  • Loan Payoff: The schedule clearly shows when the loan will be fully repaid.

Using This Calculator:

Enter the details of your mortgage: the total loan amount, the annual interest rate (as a percentage), and the loan term in years. Click "Calculate Amortization" to see your estimated monthly payment, the total principal and interest paid over the life of the loan, and a detailed amortization schedule. This tool helps you visualize your repayment journey and understand the impact of different loan terms and rates.

function calculateMortgage() { var loanAmount = parseFloat(document.getElementById("loanAmount").value); var annualInterestRate = parseFloat(document.getElementById("annualInterestRate").value); var loanTermYears = parseFloat(document.getElementById("loanTermYears").value); var errorMessageDiv = document.getElementById("errorMessage"); // Clear previous errors and results errorMessageDiv.textContent = ""; document.getElementById("monthlyPayment").textContent = "–"; document.getElementById("totalPrincipal").textContent = "–"; document.getElementById("totalInterest").textContent = "–"; document.getElementById("totalCost").textContent = "–"; document.querySelector("#amortizationTable tbody").innerHTML = ""; // Clear previous table rows // Input validation if (isNaN(loanAmount) || loanAmount <= 0) { errorMessageDiv.textContent = "Please enter a valid loan amount."; return; } if (isNaN(annualInterestRate) || annualInterestRate < 0) { errorMessageDiv.textContent = "Please enter a valid annual interest rate."; return; } if (isNaN(loanTermYears) || loanTermYears 0) { monthlyPayment = loanAmount * (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments)) / (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1); } else { monthlyPayment = loanAmount / numberOfPayments; // Simple division if interest rate is 0 } // Format monthly payment to 2 decimal places var formattedMonthlyPayment = monthlyPayment.toFixed(2); document.getElementById("monthlyPayment").textContent = "$" + formattedMonthlyPayment; var totalPrincipalPaid = loanAmount; // Initially, the total principal to be paid is the loan amount var totalInterestPaid = 0; var currentBalance = loanAmount; var amortizationRows = ""; var today = new Date(); for (var i = 0; i currentBalance) { principalPaid = currentBalance; monthlyPayment = interestPaid + principalPaid; // Adjust monthly payment for the final payment if needed } currentBalance -= principalPaid; // Ensure ending balance doesn't go negative due to minor floating point issues if (currentBalance < 0) { currentBalance = 0; } totalInterestPaid += interestPaid; // Create a date for the payment var paymentDate = new Date(today.getFullYear(), today.getMonth() + i, today.getDate()); var formattedPaymentDate = (paymentDate.getMonth() + 1) + "/" + paymentDate.getDate() + "/" + paymentDate.getFullYear(); amortizationRows += ""; amortizationRows += "" + (i + 1) + ""; amortizationRows += "" + formattedPaymentDate + ""; amortizationRows += "$" + parseFloat(currentBalance + principalPaid).toFixed(2) + ""; // Starting Balance for this row amortizationRows += "$" + monthlyPayment.toFixed(2) + ""; amortizationRows += "$" + principalPaid.toFixed(2) + ""; amortizationRows += "$" + interestPaid.toFixed(2) + ""; amortizationRows += "$" + currentBalance.toFixed(2) + ""; amortizationRows += ""; } // Calculate totals for summary var finalTotalInterestPaid = totalInterestPaid; var finalTotalCost = loanAmount + finalTotalInterestPaid; document.getElementById("totalPrincipal").textContent = "$" + totalPrincipalPaid.toFixed(2); document.getElementById("totalInterest").textContent = "$" + finalTotalInterestPaid.toFixed(2); document.getElementById("totalCost").textContent = "$" + finalTotalCost.toFixed(2); document.querySelector("#amortizationTable tbody").innerHTML = amortizationRows; } // Trigger calculation on page load with default values document.addEventListener('DOMContentLoaded', function() { calculateMortgage(); });

Leave a Comment