Skip to main content
CodeLint.Dev Dev Tools
FinTech 9 min read

EMI Calculator: The Complete Guide to Loan Formula, Amortization, and Prepayment

An Equated Monthly Instalment (EMI) is a fixed payment made to a lender on a specified date each month throughout the loan tenure. Every EMI looks the same from the outside — same rupee or dollar amount — but the split between principal and interest changes dramatically over the life of the loan. In the early months, most of your payment goes to interest. In the final months, nearly all of it goes to principal. Understanding this shift — and how to exploit it through prepayments — can save tens of thousands of dollars over the life of a mortgage or car loan.

Try the tool
Loan EMI Calculator
Calculate your EMI free →

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.

Python Python
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}")
JavaScript JavaScript
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()}`);

Frequently Asked Questions

What does EMI stand for and how is it calculated?
EMI stands for Equated Monthly Instalment. It is the fixed monthly payment made to repay a loan. The formula is: EMI = P × r × (1+r)^n / ((1+r)^n − 1), where P is the principal, r is the monthly interest rate (annual rate ÷ 12, as a decimal), and n is the loan tenure in months. The EMI remains constant throughout the loan, but the proportion of principal and interest within each payment changes — more interest early, more principal later.
Should I choose a shorter or longer loan tenure?
A shorter tenure means a higher EMI but lower total interest paid — sometimes dramatically lower. A longer tenure means a more affordable monthly payment but significantly higher total interest. The right choice depends on your cash flow: never stretch your EMI to more than 40-50% of your monthly take-home pay. If you can comfortably afford the higher EMI, always choose the shorter tenure and save on total interest. If cash flow is tight, choose a longer tenure but plan to make prepayments whenever you have surplus funds.
How does a prepayment affect my loan?
A prepayment directly reduces your outstanding principal. Because EMI interest is calculated on the outstanding balance, a lower balance means less interest accrues each month. You can instruct the bank to either: (1) reduce the tenure while keeping the EMI the same, or (2) reduce the EMI while keeping the tenure. Reducing the tenure saves more total interest. Early prepayments have a larger effect than late ones because they eliminate more future compounding.
What is the difference between fixed and floating rate loans?
A fixed rate loan has an interest rate that does not change over the tenure — your EMI is predictable. A floating rate loan has a rate linked to a benchmark (MCLR in India, SOFR in the US) that can rise or fall, changing your EMI or tenure. Floating rates are often lower initially but carry interest rate risk. In rising rate environments, floating rate home loan borrowers have seen their tenures extended by years without any change in their EMI.
Can I negotiate my loan interest rate?
Yes, especially for home loans. Lenders price risk into the rate — a higher credit score, a lower loan-to-value ratio (larger down payment), an existing banking relationship, and stable income documentation all give you negotiating leverage. Refinancing (balance transfer) to a lender offering a lower rate is also common: even a 0.5% rate reduction on a ₹20L, 20-year loan saves approximately ₹1,40,000 in total interest.
What is the difference between EMI and EPI?
EMI (Equated Monthly Instalment) uses a reducing balance: the interest component shrinks each month as the principal is repaid, so the total payment is lower overall. EPI (Equal Principal Instalment) keeps the principal repayment constant each month (P/n), while the interest component decreases — so the total monthly outflow starts high and reduces over time. EPI results in lower total interest paid than EMI for the same loan, but requires higher payments early in the tenure.

Ready to try Loan EMI Calculator?

Free, private, and runs entirely in your browser — no sign-up, no server, no data sent anywhere.

Open Loan EMI Calculator