Simple Interest Calculator
.calculator-container {
font-family: sans-serif;
border: 1px solid #ddd;
padding: 20px;
border-radius: 5px;
max-width: 500px;
margin: 20px auto;
background-color: #f9f9f9;
}
.calculator-form .form-group {
margin-bottom: 15px;
}
.calculator-form label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
.calculator-form input[type="number"] {
width: calc(100% – 12px);
padding: 8px;
border: 1px solid #ccc;
border-radius: 3px;
}
.calculator-form button {
background-color: #4CAF50;
color: white;
padding: 10px 15px;
border: none;
border-radius: 3px;
cursor: pointer;
font-size: 16px;
}
.calculator-form button:hover {
background-color: #45a049;
}
.calculator-result {
margin-top: 20px;
padding: 15px;
background-color: #e8f5e9;
border: 1px solid #c8e6c9;
border-radius: 3px;
font-size: 1.1em;
text-align: center;
}
.calculator-result strong {
color: #2e7d32;
}
function calculateSimpleInterest() {
var principal = parseFloat(document.getElementById("principal").value);
var rate = parseFloat(document.getElementById("rate").value);
var time = parseFloat(document.getElementById("time").value);
var resultDiv = document.getElementById("result");
if (isNaN(principal) || isNaN(rate) || isNaN(time) || principal < 0 || rate < 0 || time < 0) {
resultDiv.innerHTML = "
Error: Please enter valid positive numbers for all fields.";
return;
}
// Simple Interest Formula: SI = (P * R * T) / 100
var simpleInterest = (principal * rate * time) / 100;
var totalAmount = principal + simpleInterest;
resultDiv.innerHTML = "Simple Interest Earned:
$" + simpleInterest.toFixed(2) + "" +
"Total Amount (Principal + Interest):
$" + totalAmount.toFixed(2) + "";
}
Understanding Simple Interest
Simple interest is a straightforward method of calculating the interest charge on a loan or earned on an investment. It is calculated only on the original principal amount, meaning it does not compound over time. This makes it easier to understand and predict compared to compound interest.
The formula for calculating simple interest is:
SI = (P × R × T) / 100
Where:
- SI stands for Simple Interest
- P stands for the Principal amount (the initial amount of money borrowed or invested)
- R stands for the Annual Interest Rate (expressed as a percentage)
- T stands for the Time period (in years)
The total amount repayable or receivable at the end of the term is the sum of the principal amount and the calculated simple interest:
Total Amount = Principal + Simple Interest
When is Simple Interest Used?
Simple interest is commonly used for:
- Short-term loans
- Calculating interest on savings accounts (though many now offer compound interest)
- Car loans
- Some types of personal loans
Example Calculation:
Let's say you deposit $5,000 into a savings account that offers a simple annual interest rate of 4% for 5 years.
Using the formula:
- P = $5,000
- R = 4%
- T = 5 years
SI = (5000 × 4 × 5) / 100 = $1,000
The simple interest earned over 5 years would be $1,000.
The total amount in your account after 5 years would be:
Total Amount = $5,000 + $1,000 = $6,000
This calculator helps you quickly determine the simple interest and total amount for any principal, rate, and time period you provide.