Compound Annual Growth Rate (CAGR) Calculator
What is Compound Annual Growth Rate (CAGR)?
The Compound Annual Growth Rate (CAGR) is a financial metric that measures the
average annual rate of return of an investment over a specified period of time
longer than one year. It represents the 'smoothed' rate of return, assuming
that the investment grew at a steady rate each year. CAGR is a useful tool for
evaluating the performance of investments, businesses, or any metric that
experiences growth over time.
How to Calculate CAGR
The formula for calculating CAGR is as follows:
CAGR = [(Ending Value / Starting Value)^(1 / Number of Years)] – 1
Where:
- Ending Value: The value of the investment at the end of the period.
- Starting Value: The value of the investment at the beginning of the period.
- Number of Years: The total number of years over which the growth is measured.
Why is CAGR Important?
CAGR provides a more accurate picture of growth than simple average returns because it accounts
for the effect of compounding. It smooths out volatility and gives a single, representative
growth rate. This makes it easier to compare the performance of different investments or businesses
over the same time frame. For example, if you are comparing two stock investments, one that
experienced rapid growth followed by a decline and another with consistent, steady growth, CAGR
will help you understand which investment performed better on average over the entire period.
Example Calculation
Let's say you invested $10,000 in a mutual fund five years ago, and its current value is $25,000.
To calculate the CAGR:
- Starting Value = $10,000
- Ending Value = $25,000
- Number of Years = 5
CAGR = [($25,000 / $10,000)^(1 / 5)] – 1
CAGR = [(2.5)^(0.2)] – 1
CAGR = [1.2011] – 1
CAGR = 0.2011 or 20.11%
This means your investment grew at an average annual rate of approximately 20.11% over the five-year period.
function calculateCAGR() {
var initialValue = parseFloat(document.getElementById("initialValue").value);
var finalValue = parseFloat(document.getElementById("finalValue").value);
var numberOfYears = parseFloat(document.getElementById("numberOfYears").value);
var resultDiv = document.getElementById("result");
if (isNaN(initialValue) || isNaN(finalValue) || isNaN(numberOfYears) || initialValue <= 0 || finalValue <= 0 || numberOfYears <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
var cagr = Math.pow((finalValue / initialValue), (1 / numberOfYears)) – 1;
var formattedCAGR = (cagr * 100).toFixed(2);
resultDiv.innerHTML = "
CAGR Result:
" + formattedCAGR + "%";
}
.calculator-container {
font-family: sans-serif;
border: 1px solid #ccc;
padding: 20px;
border-radius: 8px;
max-width: 500px;
margin: 20px auto;
background-color: #f9f9f9;
}
.calculator-title {
text-align: center;
margin-bottom: 20px;
color: #333;
}
.calculator-form .form-group {
margin-bottom: 15px;
display: flex;
flex-direction: column;
}
.calculator-form label {
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
.calculator-form input[type="number"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
}
.calculator-form button {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
width: 100%;
transition: background-color 0.3s ease;
}
.calculator-form button:hover {
background-color: #45a049;
}
.calculator-result {
margin-top: 20px;
padding: 15px;
border: 1px solid #eee;
border-radius: 4px;
background-color: #fff;
text-align: center;
}
.calculator-result h3 {
margin-top: 0;
color: #333;
}
.calculator-result p {
font-size: 20px;
font-weight: bold;
color: #28a745;
}
.calculator-explanation {
font-family: sans-serif;
margin: 30px auto;
max-width: 800px;
line-height: 1.6;
color: #333;
}
.calculator-explanation h2,
.calculator-explanation h3 {
color: #444;
margin-top: 20px;
}
.calculator-explanation ul {
margin-left: 20px;
}
.calculator-explanation li {
margin-bottom: 10px;
}