The Compound Annual Growth Rate (CAGR) is a measure of the average annual growth rate of an investment over a specified period of time, assuming that profits were reinvested at the end of each year. It's a more accurate way to understand an investment's performance than simple average growth, as it accounts for the effects of compounding.
CAGR is calculated using the following formula:
CAGR = (Ending Value / Beginning Value)^(1 / Number of Years) – 1
Use this calculator to determine the CAGR for your investments or business metrics.
function calculateCAGR() {
var beginningValue = parseFloat(document.getElementById("beginningValue").value);
var endingValue = parseFloat(document.getElementById("endingValue").value);
var numberOfYears = parseFloat(document.getElementById("numberOfYears").value);
var resultDiv = document.getElementById("result");
if (isNaN(beginningValue) || isNaN(endingValue) || isNaN(numberOfYears)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
if (beginningValue <= 0) {
resultDiv.innerHTML = "Beginning Value must be greater than zero.";
return;
}
if (endingValue < 0) {
resultDiv.innerHTML = "Ending Value cannot be negative.";
return;
}
if (numberOfYears <= 0) {
resultDiv.innerHTML = "Number of Years must be greater than zero.";
return;
}
var cagr = Math.pow((endingValue / beginningValue), (1 / numberOfYears)) – 1;
// Format the result as a percentage
var formattedCAGR = (cagr * 100).toFixed(2);
resultDiv.innerHTML = "The Compound Annual Growth Rate (CAGR) is: " + formattedCAGR + "%";
}