Result
Your CAGR will appear here.
What is Compound Annual Growth Rate (CAGR)?
The Compound Annual Growth Rate (CAGR) is a financial metric that measures the mean annual growth rate of an investment or business over a specified period of time longer than one year. It represents the smoothed-out annual rate of return, assuming that profits were reinvested at the end of each year. CAGR is a useful way to understand how an investment or a business has performed over time, providing a more stable measure than simple annual growth rates, which can be very volatile.
The formula for CAGR is:
CAGR = [(Ending Value / Beginning Value)^(1 / Number of Years)] – 1
CAGR is widely used to evaluate past performance and can also be used as a basis for future projections. It's particularly helpful when comparing investments or businesses that have different growth trajectories and durations.
Example Calculation:
Imagine an investment started with a value of $10,000 (Beginning Value) and grew to $15,000 (Ending Value) over 5 years (Number of Years).
- Beginning Value = $10,000
- Ending Value = $15,000
- Number of Years = 5
Using the formula:
CAGR = [($15,000 / $10,000)^(1 / 5)] – 1
CAGR = [(1.5)^(0.2)] – 1
CAGR = [1.08447] – 1
CAGR = 0.08447 or 8.45%
This means the investment grew at an average annual rate of approximately 8.45% over the 5-year period, assuming growth was compounded annually.
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.textContent = "Please enter valid numbers for all fields.";
return;
}
if (beginningValue <= 0) {
resultDiv.textContent = "Beginning Value must be greater than zero.";
return;
}
if (numberOfYears <= 0) {
resultDiv.textContent = "Number of Years must be greater than zero.";
return;
}
var cagr = Math.pow((endingValue / beginningValue), (1 / numberOfYears)) – 1;
if (isNaN(cagr)) {
resultDiv.textContent = "Calculation error. Please check your inputs.";
} else {
resultDiv.textContent = "CAGR: " + (cagr * 100).toFixed(2) + "%";
}
}
.calculator-wrapper {
font-family: sans-serif;
border: 1px solid #ccc;
padding: 20px;
border-radius: 8px;
max-width: 800px;
margin: 20px auto;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.calculator-inputs, .calculator-results, .calculator-explanation {
margin-bottom: 20px;
padding: 15px;
border: 1px solid #eee;
border-radius: 5px;
}
.calculator-inputs {
background-color: #f9f9f9;
}
.calculator-results {
background-color: #e9f7e9;
font-weight: bold;
text-align: center;
font-size: 1.2em;
}
.calculator-explanation {
background-color: #fff;
line-height: 1.6;
}
.calculator-explanation h3, .calculator-explanation h4 {
color: #333;
margin-bottom: 10px;
}
.calculator-explanation p, .calculator-explanation ul {
margin-bottom: 15px;
}
.calculator-explanation li {
margin-bottom: 5px;
}
.input-group {
margin-bottom: 15px;
display: flex;
align-items: center;
gap: 10px;
}
.input-group label {
flex-basis: 150px;
text-align: right;
font-weight: bold;
}
.input-group input[type="number"] {
flex-grow: 1;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
background-color: #4CAF50;
color: white;
padding: 10px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1em;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #45a049;
}