Compound annual GDP growth rate calculator
GDP rising from 100 to 121 over 2 years grew 10% a year compounded, not 10.5%. Enter the starting and ending GDP and the years between them to get the compound rate, total growth and doubling time. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Beginning gdp
- 100
- Ending gdp
- 121
- Years
- 2
- Growth factor
- 1.21
- Total growth percent
- 21
- Cagr
- 0.1
- Cagr percent
- 10
The compound annual growth rate of GDP is the constant yearly rate that takes an economy from a beginning output level to an ending output level over a span of years. Statistical agencies, textbooks, and country briefings prefer it to a simple average of year-to-year percent changes because it smooths recessions, rebounds, and one-off shocks into a single comparable path. You supply beginning GDP, ending GDP, and the number of years between those two published levels. This calculator returns the GDP CAGR as a decimal and a percent, the total growth over the whole interval, the naive arithmetic average that people often confuse with compounding, and a label for expansion, contraction, or an unchanged level. When the rate is positive it also reports how many years output would take to double at that constant path.
What the compound annual growth rate of GDP measures, and why it smooths swings
Gross domestic product is a level for a period: the market value of final goods and services produced inside an economy, usually measured over a calendar year, in current prices (nominal GDP) or constant prices (real GDP). A single year-to-year percent change answers how much output moved last year. A multi-year compound annual growth rate answers a different question that country tables and textbooks actually ask: what constant yearly rate would take the beginning GDP level to the ending GDP level after the stated number of years.
Multiplying that factor by one hundred gives the familiar percent. A naive arithmetic mean of yearly rates, or the total percent change divided by years, treats each year as if compounding did not matter and typically overstates a volatile path. Worked identity: one hundred to one hundred twenty-one over two years is a twenty-one percent total rise but a ten percent CAGR, because 1.10 squared equals 1.21.
The extra half percentage point on the arithmetic average (twenty-one divided by two equals 10.5) is exactly the fluctuation the compound rate removes. You choose the two published levels; the algebra is the same.
Where a compound annual GDP growth rate calculator earns its keep
Introductory macroeconomics assigns multi-year GDP growth problems because students must distinguish a year-to-year change from a compound path and must not report the total percent change divided by years as if it were the compound annual growth rate. Tutoring platforms and LMS plugins need a deterministic oracle that rejects a zero or negative beginning GDP instead of inventing infinity, and that returns both the compound rate and the naive arithmetic average so a grader can mark the common mistake.
Research assistants building country comparison tables from two published GDP levels want a reproducible CAGR and an optional doubling time without rebuilding a spreadsheet for every briefing. Here the inputs are GDP levels and a year span, and the output is the macroeconomic compound annual growth rate those levels imply.
What you can do with it
Country comparison tables and briefings
Turn a pair of published GDP readings into a reproducible compound annual rate and, when growth is positive, the exact years-to-double figure for a slide or note.
FAQ
Why not just divide the total GDP percent change by the number of years?
That naive arithmetic average ignores compounding and overstates a volatile path. CAGR is the single constant yearly rate that actually takes the beginning level to the ending level. This tool returns both figures so you can see the gap.
Does this use real GDP or nominal GDP?
Either, as long as both levels use the same concept and units. The algebra does not fetch a deflator or convert currencies. Real GDP CAGR measures volume growth; nominal GDP CAGR mixes volume and prices.
What is the compound growth rate from 100 to 121 over 2 years?
It is 10% a year, because 1.10 squared is 1.21. The total rise is 21%, and dividing that by 2 gives 10.5%, the naive average the calculator also shows so you can spot the difference.
How long would GDP take to double at that rate?
At a steady 10% a year, output would double in about 7.272541 years. The calculator shows this doubling time whenever the compound rate is positive.
Can I use fractional years or a GDP that fell?
Yes. Fractional spans such as half a year are accepted, and a lower ending level gives a negative rate labelled as a contraction. Both GDP levels must be greater than zero and use the same units.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/econ/compound-growth-rate-gdp \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"beginning_gdp":100,"ending_gdp":121,"years":2}'const res = await fetch("https://api.kit.forhosting.com/econ/compound-growth-rate-gdp", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"beginning_gdp": 100,
"ending_gdp": 121,
"years": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/econ/compound-growth-rate-gdp",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"beginning_gdp": 100,
"ending_gdp": 121,
"years": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/econ/compound-growth-rate-gdp", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"beginning_gdp":100,"ending_gdp":121,"years":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"beginning_gdp":100,"ending_gdp":121,"years":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/econ/compound-growth-rate-gdp", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"beginning_gdp": 100,
"ending_gdp": 121,
"years": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "econ.compound_growth_rate_gdp",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Invalid input fails with invalid_input and is not billed.
What the compound annual growth rate of GDP measures, and why it smooths swings
The identity is (ending_gdp divided by beginning_gdp) raised to the power of one over years, minus one. Because only the two endpoints enter the power, every intermediate recession, rebound, revision, and one-off shock is smoothed out of the headline rate. That smoothing is why agencies and exam keys prefer CAGR to a simple average of annual growth rates when they compare decades or countries. This calculator implements that endpoint formula on the two GDP levels you supply. It does not download national accounts, convert currencies, splice base years, or decide whether your series is real or nominal.
Input contract, response shape, and validation behaviour
Validation rejects missing fields, empty strings, non-finite values, and any GDP level or year span that is not strictly positive, because a non-positive beginning GDP would divide by zero or leave the real power undefined, and a non-positive span cannot annualize. Failed validation is not billed. POST a JSON body with three required finite numbers: beginning_gdp, the strictly positive GDP level at the start of the span; ending_gdp, the strictly positive GDP level at the end; and years, the strictly positive length of the span in years (an integer or a fraction). Optional precision is an integer from zero to fifteen that defaults to six and controls decimal places on the numeric fields. beginning_gdp may arrive under aliases such as gdp_begin, start_gdp, initial_gdp, gdp0, gdp_start, or begin_gdp; ending_gdp accepts gdp_end, final_gdp, gdp1, end_gdp, and gdp_finish; years accepts n, periods, n_years, and year_count; precision accepts decimals and dp. Each numeric field may be a JSON number or a numeric string. Those failures return invalid_input, name the field, and do not consume prepaid balance. On success the body echoes cleaned beginning_gdp, ending_gdp, and years, then adds growth_factor (ending divided by beginning), total_growth_percent, cagr as a decimal, cagr_percent, arithmetic_average_percent (the naive total divided by years), direction as expansion, contraction, or unchanged, a formula string, and the precision used. When the compound rate is positive the body also includes years_to_double, the exact doubling time ln(2) divided by ln(1 + cagr). When the rate is negative and greater than minus one it includes years_to_halve instead. Worked example: beginning one hundred, ending one hundred twenty-one, years two yields growth_factor 1.21, total_growth_percent 21, cagr 0.1, cagr_percent 10, arithmetic_average_percent 10.5, and direction expansion. Successful parse calls use the published $0.002 base price with no model tokens and no outbound network.
Where a compound annual GDP growth rate calculator earns its keep
Pin cagr_percent and growth_factor in tests, reject non-positive GDP explicitly, and you get reproducible long-run growth figures for homework, country notes, and lightweight dashboards without hosting a national-accounts pipeline or floating-point edge cases of your own.
Integration use cases
Homework and exam multi-year GDP growth
Enter two textbook GDP levels and the year span, then check cagr_percent against the endpoint identity and contrast it with the naive arithmetic average.
LMS and tutoring auto-grading
Score GDP CAGR items with a deterministic oracle that rejects non-positive beginning_gdp or years as invalid_input instead of silently returning Infinity.
Technical questions
How is the compound annual growth rate of GDP calculated?
Send beginning_gdp, ending_gdp, and years. The API returns cagr = (ending_gdp / beginning_gdp)^(1 / years) − 1 and cagr_percent = cagr × 100, plus the total growth over the whole span.
What if ending GDP is lower than beginning GDP?
That is a contraction: cagr and cagr_percent are negative, direction is contraction, and the response includes years_to_halve (the exact time to lose half the output at that constant rate) instead of years_to_double.
What does the compound annual GDP growth rate calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.