Interactive GDP Calculator: Build Your Own GDP Formula
Plug in consumer spending (C), business investment (I), government spending (G), exports (X), and imports (M). The calculator rolls them up into GDP using the expenditure formula. No other major GDP resource has one.
Load a preset scenario:
Household spending on goods and services
Equipment, construction, inventory, IP
Direct purchases of goods and services
Goods and services sold to foreign buyers
Goods and services bought from abroad
GDP = C + I + G + (X - M)
$19.8T + $5.3T + $5.0T + ($3.2T - $4.1T) =
$29.20T
C
67.8%
I
18.2%
G
17.1%
X-M
-3.1%
Values in US trillions of dollars. US 2025 defaults from BEA NIPA (illustrative, rounded). Germany and India figures are approximations from IMF/national statistics.
Understanding the Results
Why does GDP fall when you raise imports?
Imports are subtracted because the formula aims to measure domestic production. Consumer spending (C), investment (I), and government (G) all count purchases regardless of where the item was made. When a US consumer buys a Korean television, that purchase is in C. But the TV was produced in Korea, not the US. Subtracting imports removes the foreign-made portion from what we count as domestic output.
Why are Germany and India structured so differently?
Germany's net exports are positive: it exports far more than it imports, reflecting its manufacturing and capital-goods orientation. India's net exports are also slightly negative but much smaller relative to GDP than the US; its economy is more consumption and services-led than Germany's. The US runs a large persistent trade deficit because Americans buy heavily from the rest of the world and the dollar's reserve-currency status makes it structurally easy to finance that deficit.
Why is government spending (G) much smaller than the total government budget?
The GDP government component covers only direct purchases of goods and services (public-sector wages, defence procurement, infrastructure). Transfer payments like Social Security, Medicare, and unemployment benefits are not in G because they are income redistribution, not government production of output. Only when recipients spend their benefits does the money enter GDP (as consumer spending, C).