Annual Salary Hourly Rate Calculator Australia

EMI Calculator (Loan Repayment)

This EMI calculator helps you estimate your Equated Monthly Installment for a loan. EMI stands for Equated Monthly Installment, which is a fixed amount paid by a borrower to a lender at a specified date each month. EMIs are used to pay off both interest and principal on a loan over time. The EMI amount depends on the loan principal, the interest rate, and the loan tenure (duration). Use this calculator to understand how these factors influence your monthly payments and plan your loan repayments effectively.

function calculateEMI() { var loanAmount = parseFloat(document.getElementById("loanAmount").value); var annualInterestRate = parseFloat(document.getElementById("annualInterestRate").value); var loanTenureMonths = parseFloat(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; } // Calculate monthly interest rate var monthlyInterestRate = annualInterestRate / 12 / 100; var emi = 0; if (monthlyInterestRate === 0) { // Simple division if interest rate is 0 emi = loanAmount / loanTenureMonths; } else { // EMI formula: P * r * (1 + r)^n / ((1 + r)^n – 1) // Where P = Principal loan amount, r = monthly interest rate, n = loan tenure in months emi = loanAmount * monthlyInterestRate * Math.pow(1 + monthlyInterestRate, loanTenureMonths) / (Math.pow(1 + monthlyInterestRate, loanTenureMonths) – 1); } var totalPayment = emi * loanTenureMonths; var totalInterest = totalPayment – loanAmount; resultDiv.innerHTML = "Your EMI is: ₹" + emi.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') + "" + "Total Interest Payable: ₹" + totalInterest.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') + "" + "Total Amount Payable (Principal + Interest): ₹" + totalPayment.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') + ""; } .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 4px rgba(0, 0, 0, 0.1); background-color: #f9f9f9; } .calculator-title { text-align: center; color: #333; margin-bottom: 15px; } .calculator-description { color: #555; line-height: 1.6; margin-bottom: 25px; text-align: justify; } .calculator-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 25px; } .input-group { display: flex; flex-direction: column; } .input-group label { margin-bottom: 8px; font-weight: bold; color: #444; } .input-group input[type="number"] { padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; box-sizing: border-box; /* Important for padding and border */ } .input-group input[type="number"]:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25); } .calculator-button { display: block; width: 100%; padding: 12px 20px; background-color: #007bff; color: white; border: none; border-radius: 4px; font-size: 18px; cursor: pointer; transition: background-color 0.3s ease; margin-bottom: 20px; } .calculator-button:hover { background-color: #0056b3; } .calculator-result { margin-top: 20px; padding: 15px; border: 1px solid #e0e0e0; border-radius: 5px; background-color: #ffffff; text-align: center; } .calculator-result p { margin: 8px 0; color: #333; font-size: 1.1em; } .calculator-result strong { color: #28a745; /* Green for emphasis on results */ } .error-message { color: #dc3545; /* Red for error messages */ font-weight: bold; }

Leave a Comment