GDP Calculator

Compute Gross Domestic Product by the expenditure approach: C + I + G + (X − M).

$
$
$
$
$
A price index; 100 means base-year prices. Above 100 means prices have risen.
Nominal GDP
Net exports (X − M)
Real GDP

Results update as you type.

About this calculator

This GDP calculator measures Gross Domestic Product by the expenditure approach: the total spending on a country’s final goods and services. The formula is GDP = Consumption + Investment + Government spending + Net exports, where net exports are Exports − Imports. Consumption is household spending, investment is business capital and housing, government is public spending (not transfers), and net exports turn negative when a country imports more than it exports.

For example, with 14,000 of consumption, 4,000 of investment, 3,500 of government spending, 2,500 of exports and 3,000 of imports, net exports are −500, so GDP = 14,000 + 4,000 + 3,500 − 500 = 21,000. That figure is nominal GDP in current prices; entering a GDP deflator (a price index with a base year of 100) converts it to real GDP = nominal × 100 ÷ deflator, so a deflator of 105 would put real GDP at about 20,000.

Use it to build up GDP from its components, to see each part’s share of the total, or to strip out inflation and compare output across years. Because it captures only final spending, it deliberately excludes transfers like pensions and intermediate goods to avoid double-counting.

Frequently asked questions

What is the expenditure approach to GDP?

It totals all spending on final output: household consumption (C), business and housing investment (I), government spending (G) and net exports (exports minus imports). The sum equals GDP because every dollar of output is bought by someone.

What is the difference between nominal and real GDP?

Nominal GDP values output at current prices, so it rises with inflation. Real GDP uses a base year’s prices via the GDP deflator (real = nominal × 100 ÷ deflator), isolating the change in actual quantity of goods and services produced.

Why can net exports be negative?

When a country imports more than it exports, exports minus imports is negative, which subtracts from GDP. A trade deficit lowers the net-exports component but does not by itself mean the economy is shrinking.

What is a GDP deflator?

The GDP deflator is a broad price index for all goods and services in GDP, set to 100 in a base year. A value above 100 means prices have risen since the base year; dividing nominal GDP by it (times 100) gives real GDP, removing the effect of those price changes.

What does the expenditure approach exclude?

It counts only spending on final goods and services, so it leaves out intermediate goods (to avoid double-counting) and transfer payments like pensions, unemployment benefits and gifts, which move money without producing new output. Second-hand sales are excluded too.

How does the expenditure approach differ from the income approach?

The expenditure approach totals what is spent on output (C + I + G + net exports), while the income approach totals what is earned producing it — wages, profits, rent and interest. In principle both give the same GDP, since every dollar spent is a dollar of income to someone.

What counts as investment in GDP?

In GDP, investment (I) means business spending on capital like machinery and buildings, new residential construction, and changes in inventories — not buying stocks or bonds, which are financial transfers. Enter only real capital spending in the investment field.

❤️ Love Calculator.Free? Share it

𝕏  X Facebook Reddit
API — use this calculator from code

Call this calculator as a free JSON endpoint — no key required. Send the field values below as query parameters or JSON. Read the full API docs →

Endpoint

GET https://calculator.free/api/v1/gdp/

curl

curl "https://calculator.free/api/v1/gdp/?consumption=14000&investment=4000&government=3500&exports=2500&imports=3000"

JavaScript fetch()

const r = await fetch(
  "https://calculator.free/api/v1/gdp/?" + new URLSearchParams({
    "consumption": "14000",
    "investment": "4000",
    "government": "3500",
    "exports": "2500",
    "imports": "3000"
  }));
const data = await r.json();
console.log(data.results);

Results are estimates for general guidance only, not financial, medical or tax advice.