EMI Calculator (Equated Monthly Installment)
What is an EMI?
An Equated Monthly Installment (EMI) is a fixed amount paid by a borrower to a lender at a specified date each month. EMIs are used to repay loans, including home loans, car loans, personal loans, and education loans. Each EMI payment comprises both a principal component (the actual amount borrowed) and an interest component (the cost of borrowing).
The EMI amount remains constant throughout the loan tenure, but the proportion of principal and interest changes with each payment. Initially, a larger portion of the EMI goes towards paying interest, while a smaller portion goes towards the principal. As the loan progresses, this proportion shifts, with more of the EMI contributing to the principal repayment.
How is EMI Calculated?
The formula used to calculate EMI is:
EMI = P * r * (1 + r)^n / ((1 + r)^n - 1)
Where:
P = Principal loan amount
r = Monthly interest rate (Annual interest rate / 12 / 100)
n = Loan tenure in months
Our calculator simplifies this process for you. Simply enter the loan amount, annual interest rate, and the loan tenure in months, and it will compute your EMI.
function calculateEMI() {
var loanAmount = parseFloat(document.getElementById("loanAmount").value);
var annualInterestRate = parseFloat(document.getElementById("annualInterestRate").value);
var loanTenureMonths = parseInt(document.getElementById("loanTenureMonths").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
if (isNaN(loanAmount) || isNaN(annualInterestRate) || isNaN(loanTenureMonths) || loanAmount <= 0 || annualInterestRate < 0 || loanTenureMonths <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
var monthlyInterestRate = (annualInterestRate / 12) / 100;
var tenureInMonths = loanTenureMonths;
// Calculate EMI
var numerator = monthlyInterestRate * Math.pow((1 + monthlyInterestRate), tenureInMonths);
var denominator = Math.pow((1 + monthlyInterestRate), tenureInMonths) – 1;
var emi = loanAmount * (numerator / denominator);
// Calculate Total Interest Paid and Total Payment
var totalPayment = emi * tenureInMonths;
var totalInterestPaid = totalPayment – loanAmount;
// Display the results
resultDiv.innerHTML =
"
Your EMI: ₹ " + emi.toFixed(2) + "" +
"
Total Interest Payable: ₹ " + totalInterestPaid.toFixed(2) + "" +
"
Total Loan Repayment: ₹ " + totalPayment.toFixed(2) + "";
}
.calculator-container {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.calculator-title {
text-align: center;
color: #333;
margin-bottom: 20px;
}
.calculator-form .form-group {
margin-bottom: 15px;
}
.calculator-form label {
display: block;
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
.calculator-form input[type="number"] {
width: calc(100% – 22px);
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.calculator-form button {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
width: 100%;
transition: background-color 0.3s ease;
}
.calculator-form button:hover {
background-color: #45a049;
}
.calculator-result {
margin-top: 25px;
padding: 15px;
background-color: #f9f9f9;
border: 1px solid #eee;
border-radius: 4px;
}
.calculator-result p {
margin: 10px 0;
color: #333;
font-size: 1.1em;
}
.calculator-explanation {
margin-top: 30px;
border-top: 1px solid #eee;
padding-top: 20px;
}
.calculator-explanation h3 {
color: #333;
margin-bottom: 10px;
}
.calculator-explanation p, .calculator-explanation ul {
color: #666;
line-height: 1.6;
}
.calculator-explanation code {
background-color: #f0f0f0;
padding: 2px 4px;
border-radius: 3px;
}