When shopping for a Certificate of Deposit (CD), you will often see two numbers: the Interest Rate (Nominal Rate) and the APY (Annual Percentage Yield). The APY is the more important number because it reflects the effect of compounding.
The APY Formula
To calculate the APY manually, you use the following mathematical formula:
APY = (1 + r/n)^n – 1
r = The stated annual interest rate (as a decimal)
n = The number of compounding periods per year
Real-World Example
Imagine a bank offers a 12-month CD with a 5.00% interest rate, compounded monthly. Here is how the APY calculation works:
Convert the rate to a decimal: 5.00% / 100 = 0.05
Divide by compounding periods: 0.05 / 12 = 0.004167
Add 1: 1.004167
Raise to the power of 12: (1.004167)^12 = 1.05116
Subtract 1: 0.05116 or 5.116% APY
Compounding Frequency Impact
The more frequently interest is added back to your balance, the higher your APY will be, even if the interest rate stays the same. Daily compounding will always yield more than monthly or annual compounding. Our calculator allows you to toggle between these frequencies to see the "hidden" value of frequent compounding.
function calculateAPY() {
var nominalRateInput = document.getElementById("nominalRate").value;
var n = parseFloat(document.getElementById("compoundingType").value);
var resultBox = document.getElementById("apyResultBox");
var apyDisplay = document.getElementById("apyDisplay");
var comparisonText = document.getElementById("comparisonText");
if (nominalRateInput === "" || isNaN(nominalRateInput)) {
alert("Please enter a valid interest rate.");
return;
}
var r = parseFloat(nominalRateInput) / 100;
// APY Formula: (1 + r/n)^n – 1
var apy = Math.pow((1 + (r / n)), n) – 1;
var apyPercentage = apy * 100;
apyDisplay.innerText = apyPercentage.toFixed(3) + "%";
var difference = apyPercentage – (r * 100);
comparisonText.innerText = "This is " + difference.toFixed(3) + "% higher than your nominal rate due to compounding " + getFreqName(n) + ".";
resultBox.style.display = "block";
}
function getFreqName(n) {
if (n === 365) return "daily";
if (n === 12) return "monthly";
if (n === 4) return "quarterly";
if (n === 2) return "semi-annually";
return "annually";
}