💰
💰 Money tools

GDP Calculator (expenditure approach: C + I + G + X − M)

Results update as you type.

Your numbers

Understanding the GDP calculator — concept and principle

This calculator adds up gross domestic product (GDP) from the expenditure side: household consumption, business investment, government purchases and net exports. It also shows each component's share of GDP, net exports and whether the economy runs a trade surplus or deficit. Use it for economics homework, reading national accounts and understanding what drives GDP.

GDP by the expenditure approachGDP = C + I + G + (X − M)C 14.0I 3.6G 3.9XGDP 20.9M 2.7exports 2.1 − imports 2.7 = net exports −0.6GDP20.9C 67% · I 17.2% · G 18.7% · net exports −2.9%
Imports are subtracted because they are already counted inside C, I and G but were produced abroad.

How it is calculated

GDP = C + I + G + (X − M)

Enter all components in the same unit, for example trillions of dollars.

The principle

GDP measures the value of all final goods and services produced in a country in a period. Everything produced is bought by someone: households, businesses, government or foreigners. So adding up spending on final goods measures production. Imports are subtracted because they are already included in C, I and G but were produced abroad. Buying shares or bonds is not investment in this sense, and transfer payments such as pensions are not part of G because nothing is produced in return.

Worked example

Default inputs (rounded US figures, trillions of dollars, from OpenStax Table 19.1): C = 14.0, I = 3.6, G = 3.9, X = 2.1, M = 2.7.

  1. Net exports = 2.1 − 2.7 = −0.6.
  2. GDP = 14.0 + 3.6 + 3.9 − 0.6 = 20.9.
  3. Consumption share = 14.0 ÷ 20.9 ≈ 67%; investment ≈ 17.2%; government ≈ 18.7%.
  4. Net exports share ≈ −2.9%: a trade deficit.
How GDP = C + I + G + (X − M) changes with Household consumption (C)How GDP = C + I + G + changes with House…1015202530353.5710.51417.52128Example: 20.9Household consumption (C)
Each point is the calculator re-run with only “Household consumption (C)” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Household consumption (C)GDP = C + I + G + (X − M)
3.510.4
713.9
10.517.4
1420.9
17.524.4
2127.9
2834.9

How to read the result

In the US, consumption is about two thirds of GDP, so household spending drives the economy. Investment is the most volatile component and often falls sharply in recessions. A negative net export share means the country imports more than it exports; it does not by itself mean the economy is weak.

Common mistakes

Keep in mind: Official GDP figures come from national statistics agencies and are revised. Use their published data for real analysis. This is not financial advice.

Frequently asked questions

What is the expenditure approach to GDP?

Adding consumption, investment, government purchases and net exports.

Why are imports subtracted?

They are included in spending but were produced abroad, so they are not domestic production.

Can investment be negative?

Yes, if inventories fall sharply enough to outweigh new investment.

Sources: OpenStax, Principles of Economics, 3rd ed. (2022), §19.1 Measuring the Size of the Economy: Gross Domestic Product

Checked 9 Nov 2026. OpenStax, “Principles of Economics”, 3rd ed. (2022), section 19.1 “Measuring the Size of the Economy: Gross Domestic Product”: GDP = C + I + G + (X − M), component definitions and Table 19.1 (components of US GDP from the demand side).

💰 All money tools →🌍 Calculators by country →