The EMI Formula Explained
EMI is calculated using the standard reducing-balance formula:
EMI = P × r × (1 + r)^n
─────────────────────
(1 + r)^n − 1
Where:
- P — principal loan amount
- r — monthly interest rate = annual rate / 12 (as a decimal)
- n — number of monthly instalments (loan tenure in months)
Example: ₹20,00,000 home loan at 8.5% per annum for 20 years (240 months):
r = 0.085 / 12 = 0.007083...
n = 240
EMI = 20,00,000 × 0.007083 × (1.007083)^240
─────────────────────────────────────
(1.007083)^240 − 1
= 20,00,000 × 0.007083 × 5.3025
─────────────────────────────
5.3025 − 1
= 17,356 / month (approx)
Over 240 months, total payment = 17,356 × 240 = ₹41,65,440. Total interest paid = 41,65,440 − 20,00,000 = ₹21,65,440 — more than the original loan amount. This is the uncomfortable truth about long-tenure home loans.
How Amortization Works: The Principal-Interest Split
Each EMI payment is divided into two parts: the interest component (calculated on the outstanding principal) and the principal component (which reduces the outstanding balance). As the outstanding principal decreases with each payment, the interest component shrinks and the principal component grows.
For the first payment of our ₹20,00,000 example:
- Interest = ₹20,00,000 × 0.007083 = ₹14,167
- Principal = ₹17,356 − ₹14,167 = ₹3,189
- Outstanding balance after payment 1: ₹20,00,000 − ₹3,189 = ₹19,96,811
For payment 120 (10 years in, halfway through):
- Outstanding balance: approximately ₹14,40,000
- Interest = ₹14,40,000 × 0.007083 = ₹10,200
- Principal = ₹17,356 − ₹10,200 = ₹7,156
For payment 240 (final payment):
- Outstanding balance: approximately ₹17,234
- Interest = ₹17,234 × 0.007083 = ₹122
- Principal = ₹17,356 − ₹122 = ₹17,234
The amortization curve is steep: in the first 5 years of a 20-year loan, you pay back approximately 8% of the principal. In the final 5 years, you pay back approximately 34%. This front-loading of interest is why prepayments made early in the loan term have a disproportionately large effect on total interest paid.
Total Cost of a Loan: What You Actually Pay
The advertised interest rate tells you the rate; the total interest paid tells you the real cost. These can be strikingly different, especially for long-tenure loans:
| Loan (₹20L at 8.5%) | Monthly EMI | Total Payment | Total Interest |
|---|---|---|---|
| 10 years | ₹24,797 | ₹29,75,640 | ₹9,75,640 |
| 15 years | ₹19,690 | ₹35,44,200 | ₹15,44,200 |
| 20 years | ₹17,356 | ₹41,65,440 | ₹21,65,440 |
| 30 years | ₹15,356 | ₹55,28,160 | ₹35,28,160 |
Extending a loan from 10 to 30 years reduces the monthly payment by ₹9,441 — but increases total interest paid by ₹25,52,520. The lower EMI comes at a high price over the full tenure.
Prepayment Strategies: How to Save Lakhs in Interest
A prepayment (or part-prepayment) is any payment made towards the loan principal beyond the regular EMI. Because the EMI formula is recalculated on the remaining principal, a single prepayment made early in the loan tenure can save many multiples of itself in total interest.
Two prepayment strategies:
- Reduce tenure (keep EMI constant): After prepayment, the bank recalculates a shorter tenure at the same EMI. Every future EMI now attacks a smaller principal. This strategy minimises total interest paid and is preferred for borrowers with income certainty.
- Reduce EMI (keep tenure constant): The bank reduces your monthly payment while keeping the tenure the same. This improves monthly cash flow but saves less in total interest than the tenure-reduction strategy.
Example impact of a one-time prepayment: On our ₹20L / 8.5% / 20-year loan, making a single ₹2,00,000 prepayment at the end of year 1:
- Remaining tenure reduces from ~228 months to ~198 months (saves 2.5 years)
- Total interest saved: approximately ₹3,80,000
- The ₹2,00,000 prepayment "returns" nearly ₹5,80,000 in benefit (principal back + interest saved)
Before prepaying, check whether your loan has a prepayment penalty. Fixed-rate loans often do; floating-rate loans in India cannot legally charge prepayment penalties on home loans (RBI circular).
Code Examples: EMI Calculation and Amortization Schedule
These implementations calculate the EMI and generate the full amortization table.
def calculate_emi(principal, annual_rate, tenure_months):
"""
Returns (emi, total_payment, total_interest)
"""
r = annual_rate / 12 / 100 # monthly rate
if r == 0:
return principal / tenure_months, principal, 0
emi = principal * r * (1 + r)**tenure_months / ((1 + r)**tenure_months - 1)
total = emi * tenure_months
return round(emi, 2), round(total, 2), round(total - principal, 2)
def amortization_schedule(principal, annual_rate, tenure_months):
"""
Returns list of dicts: month, opening_balance, emi,
interest, principal_paid, closing_balance
"""
r = annual_rate / 12 / 100
emi, _, _ = calculate_emi(principal, annual_rate, tenure_months)
balance = principal
schedule = []
for month in range(1, tenure_months + 1):
interest = round(balance * r, 2)
principal_paid = round(emi - interest, 2)
closing = round(balance - principal_paid, 2)
schedule.append({
'month': month,
'opening': round(balance, 2),
'emi': emi,
'interest': interest,
'principal': principal_paid,
'closing': max(closing, 0),
})
balance = max(closing, 0)
return schedule
# Example: ₹2,000,000 loan at 8.5% for 20 years
emi, total, interest = calculate_emi(2_000_000, 8.5, 240)
print(f"Monthly EMI: ₹{emi:,.2f}")
print(f"Total payment: ₹{total:,.2f}")
print(f"Total interest: ₹{interest:,.2f}")function calculateEMI(principal, annualRate, tenureMonths) {
const r = annualRate / 12 / 100;
if (r === 0) return { emi: principal / tenureMonths, total: principal, interest: 0 };
const emi = (principal * r * Math.pow(1 + r, tenureMonths)) /
(Math.pow(1 + r, tenureMonths) - 1);
const total = emi * tenureMonths;
return {
emi: Math.round(emi * 100) / 100,
total: Math.round(total * 100) / 100,
interest: Math.round((total - principal) * 100) / 100,
};
}
function amortizationSchedule(principal, annualRate, tenureMonths) {
const r = annualRate / 12 / 100;
const { emi } = calculateEMI(principal, annualRate, tenureMonths);
let balance = principal;
return Array.from({ length: tenureMonths }, (_, i) => {
const interest = Math.round(balance * r * 100) / 100;
const principalPaid = Math.round((emi - interest) * 100) / 100;
const closing = Math.max(Math.round((balance - principalPaid) * 100) / 100, 0);
const row = { month: i + 1, opening: balance, emi, interest, principal: principalPaid, closing };
balance = closing;
return row;
});
}
const { emi, total, interest } = calculateEMI(2_000_000, 8.5, 240);
console.log(`EMI: ₹${emi.toLocaleString()}`);
console.log(`Total interest: ₹${interest.toLocaleString()}`);