GDP Calculator · Practical guide
How to Calculate GDP Using the Expenditure Approach
Add consumption, investment, and government spending, then add net exports — that is GDP.
At a glance
The Expenditure Approach Formula
The expenditure approach calculates GDP with the formula GDP = C + I + G + (X − M), where C is consumption, I is investment, G is government spending, X is exports, and M is imports. Add the spending, subtract imports, and you have total output.
Interactive tool
GDP Calculator
Enter your own values, then compare the result with the examples below.
Results
Worked Example
Suppose an economy reports, in billions of dollars: consumption of $10,000, investment of $3,000, government spending of $4,000, exports of $2,000, and imports of $2,500. Then:
GDP = 10,000 + 3,000 + 4,000 + (2,000 − 2,500) = $16,500 billion
Notice that imports are subtracted because that spending leaves the domestic economy. Enter these same five values in the calculator above to reproduce the result.
What Each Component Covers
- Consumption (C): household spending on goods and services — typically the largest share of GDP, around two-thirds in the US.
- Investment (I): business spending on equipment, structures, and inventories, plus residential construction.
- Government spending (G): government purchases of goods and services, excluding transfer payments like Social Security.
- Net exports (X − M): exports minus imports. A trade deficit makes this term negative and drags GDP down.
Keep Units Consistent
You can work in millions, billions, or trillions — the formula is unit-agnostic. Just make sure every input uses the same unit, or the sum will be meaningless.
Frequently Asked Questions
Why are imports subtracted in the GDP formula?
Imports are produced abroad, so they are not domestic output. They get subtracted because consumption, investment, and government spending figures already include imported goods.
Do transfer payments count in government spending?
No. Social Security checks and unemployment benefits are transfers, not purchases of goods or services, so they are excluded from G in the GDP formula.
Can net exports be negative?
Yes. When a country imports more than it exports, X minus M is negative, which reduces measured GDP. The United States has run negative net exports for decades.
What is the largest component of US GDP?
Consumption is by far the largest component, making up roughly 68% of US GDP. Government spending and investment each account for about 17-18%.