Please enter valid positive numbers for all fields. Years must be greater than 0.
Compound Annual Growth Rate
0.00%
function calculateCAGR() {
// 1. Get input values
var startValInput = document.getElementById('initialValue');
var endValInput = document.getElementById('finalValue');
var yearsInput = document.getElementById('periodYears');
var startVal = parseFloat(startValInput.value);
var endVal = parseFloat(endValInput.value);
var years = parseFloat(yearsInput.value);
var resultContainer = document.getElementById('result-container');
var resultElement = document.getElementById('cagr-result');
var summaryElement = document.getElementById('growth-summary');
var errorMsg = document.getElementById('error-message');
// 2. Validate inputs
// Ensure inputs are numbers, startVal is greater than 0 (to avoid division by zero or complex numbers in this context)
// Years must be greater than 0 to divide the exponent
if (isNaN(startVal) || isNaN(endVal) || isNaN(years) || years <= 0 || startVal = 0 ? "growth" : "decline";
var trendColor = cagrPercent >= 0 ? "green" : "red";
summaryElement.innerHTML =
"Your investment grew from $" + startVal.toLocaleString() + " to $" + endVal.toLocaleString() + " over " + years + " years." +
"Total Return: " + totalGrowthPercent.toFixed(2) + "% ($" + absoluteChange.toLocaleString() + ").";
resultContainer.style.display = 'block';
}
What is Compound Annual Growth Rate (CAGR)?
The Compound Annual Growth Rate (CAGR) is one of the most accurate ways to calculate and determine returns for anything that can rise or fall in value over time. Unlike a simple average return, which can be misleading due to volatility, CAGR measures the geometric progression ratio that provides a constant rate of return over the time period.
In simpler terms, CAGR tells you what an investment would have yielded on an annual basis if it had grown at a steady rate, compounding effectively every year. It smoothes out the "noise" of market fluctuations to give you a single percentage number that represents your annualized growth.
How the CAGR Formula Works
The calculation assumes that gains are reinvested at the end of each year. The mathematical formula used in the calculator above is:
CAGR = ( Ending Value / Beginning Value )( 1 / n ) – 1
Where:
Ending Value: The value of the investment at the end of the period.
Beginning Value: The initial value of the investment at the start.
n: The number of years (or periods) involved.
Why Use a CAGR Calculator?
Investors prefer CAGR over absolute return metrics because it accounts for the element of time. For example:
Comparing Investments: It allows you to compare the performance of two different investments held for different periods of time.
Evaluating Fund Managers: It is the standard metric used to evaluate the historical performance of mutual funds and ETFs.
Projecting Future Value: While past performance doesn't guarantee future results, knowing the historical CAGR helps in setting realistic expectations for future portfolio growth.
Example Calculation
Imagine you invested $10,000 in a portfolio (Beginning Value). After 5 years (n), the portfolio is worth $15,000 (Ending Value).
Using the calculator:
Divide $15,000 by $10,000 = 1.5
Raise 1.5 to the power of (1/5) or 0.2 = 1.08447
Subtract 1 = 0.08447
Multiply by 100 = 8.45%
This means your investment grew at an effective steady rate of 8.45% per year, even if the actual year-to-year returns varied drastically.