A Certificate of Deposit (CD) is a type of savings account offered by banks and credit unions that provides a fixed interest rate over a specified term. Unlike regular savings accounts, CDs typically have penalties for early withdrawal, but they offer a guaranteed return and are generally considered very low-risk investments.
This calculator helps you estimate the total amount you will have at the end of your CD's term, considering your initial deposit, the annual interest rate, the term length, and how frequently the interest is compounded.
How the Calculation Works
The total yield of a CD is calculated using the compound interest formula. Compound interest means that your interest earnings are added to your principal, and then future interest is calculated on this new, larger principal. This leads to exponential growth over time.
The formula used is:
A = P (1 + r/n)^(nt)
A = the future value of the investment/loan, including interest
P = the principal investment amount (the initial deposit)
r = the annual interest rate (as a decimal)
n = the number of times that interest is compounded per year
t = the number of years the money is invested or borrowed for
In our calculator, we adapt this formula to work with months.
The rate per compounding period is (annual interest rate / compounding frequency).
The total number of compounding periods is (term in months / 12) * compounding frequency.
So, the modified calculation for the total amount (A) is:
A = P (1 + (r/100)/n)^( (term_months/12) * n )
Where:
P = Initial Deposit
r = Annual Interest Rate (%)
n = Compounding Frequency (e.g., 1 for annually, 12 for monthly)
term_months = Term in Months
The total interest earned is then calculated as Total Interest = A – P.
When to Use This Calculator
Comparing CD Offers: See which CD product will yield the most based on its rate, term, and compounding frequency.
Financial Planning: Estimate how much your savings will grow in a CD over a specific period.
Understanding Investment Growth: Visualize the power of compound interest on your deposited funds.
Remember that the actual yield may vary slightly due to specific bank calculation methods and potential fees. Always consult with your financial institution for exact figures.
function calculateCDYield() {
var principal = parseFloat(document.getElementById("principalAmount").value);
var annualRate = parseFloat(document.getElementById("annualInterestRate").value);
var termMonths = parseFloat(document.getElementById("termMonths").value);
var compoundingFrequency = parseInt(document.getElementById("compoundingFrequency").value);
var resultDiv = document.getElementById("result");
if (isNaN(principal) || isNaN(annualRate) || isNaN(termMonths) || isNaN(compoundingFrequency)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
if (principal < 0 || annualRate < 0 || termMonths < 1) {
resultDiv.innerHTML = "Principal and rate cannot be negative. Term must be at least 1 month.";
return;
}
// Convert annual rate to decimal for calculation
var rateDecimal = annualRate / 100;
// Calculate the number of years
var years = termMonths / 12;
// Calculate the total future value using the compound interest formula
// A = P (1 + r/n)^(nt)
// Here: r is rateDecimal, n is compoundingFrequency, t is years
var exponent = compoundingFrequency * years;
var base = 1 + (rateDecimal / compoundingFrequency);
// Handle potential issues with very large exponents or bases if needed, though unlikely for typical CD terms
if (base <= 0) {
resultDiv.innerHTML = "Calculation error: Base is zero or negative.";
return;
}
var futureValue = principal * Math.pow(base, exponent);
// Calculate total interest earned
var totalInterest = futureValue – principal;
// Format the results for display
var formattedFutureValue = futureValue.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedTotalInterest = totalInterest.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedPrincipal = principal.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
resultDiv.innerHTML = "