# What is the GDP from its parts?

Computes gross domestic product by the expenditure approach, GDP = C + I + G + (X − M), with net exports, each part’s share, real GDP from a deflator, and GDP per person.

- Page: https://www.acalculator.org/finance/gdp-calculator
- JSON spec: https://www.acalculator.org/finance/gdp-calculator.json
- Version: cea016e55a7c

## Default answer

Example with the default inputs (Amounts are in Trillions of dollars, Consumption (C) 14, Investment (I) 3.6, Government (G) 3.9, Exports (X) 2.1, Imports (M) 2.7): GDP = $20.9 trillion.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| in | Amounts are in | The unit every amount below is typed in: dollars, or thousands, millions, billions or trillions of dollars. |
| c | Consumption (C) | Personal consumption expenditures: what households spend on goods and services. |
| i | Investment (I) | Gross private domestic investment: business equipment and buildings, new homes, and the change in inventories. |
| g | Government (G) | Government consumption expenditures and gross investment. |
| x | Exports (X) | Goods and services sold to other countries. |
| m | Imports (M) | Goods and services bought from other countries. |
| defl | GDP deflator (price index) | The GDP price index for the year, with the base year = 100. Leave empty to skip real GDP. |
| pop | Population | How many people live in the country. Leave empty to skip GDP per person. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| gdp | GDP | C + I + G + (X − M), in the unit you chose. |
| text | GDP in words | GDP with its unit, for example $20.9 trillion. |
| net | Net exports (X − M) | Exports − imports: a trade surplus when positive, a deficit when negative. |
| cShare | Consumption share | C ÷ GDP × 100. |
| iShare | Investment share | I ÷ GDP × 100. |
| gShare | Government share | G ÷ GDP × 100. |
| nShare | Net exports share | (X − M) ÷ GDP × 100. |
| real | Real GDP | GDP ÷ (deflator ÷ 100), in base-year dollars, in the unit you chose. |
| perPerson | GDP per person | GDP in dollars ÷ population. |

## Method

GDP = C + I + G + (X − M); real GDP = GDP ÷ (deflator ÷ 100); GDP per person = GDP in dollars ÷ population.

## Assumptions

- The expenditure approach of the national accounts (BEA): consumption, investment, government, and exports minus imports.
- You type every amount, in one unit; no data is looked up.
- Real GDP uses the deflator you type, with its base year = 100.

## Worked examples

1. in = trillions, c = 14, i = 3.6, g = 3.9, x = 2.1, m = 2.7 gives gdp = 20.9, net = -0.6, text = $20.9 trillion. Source: OpenStax, Principles of Macroeconomics 3e, §6.1, Table 6.1 Components of U.S. GDP (consumption $14.0, investment $3.6, government $3.9, exports $2.1, imports −$2.7, total $20.9 trillion), https://openstax.org/books/principles-macroeconomics-3e/pages/6-1-measuring-the-size-of-the-economy-gross-domestic-product.
2. in = billions, c = 542.4, i = 0, g = 0, x = 0, m = 0, defl = 16.6 gives real = 3,267.46988. Source: OpenStax, Principles of Macroeconomics 3e, §6.2 Adjusting Nominal Values to Real Values (real GDP = nominal GDP ÷ (price index ÷ 100); 1960: $542.4 billion ÷ 0.166 = $3,267.5 billion), https://openstax.org/books/principles-macroeconomics-3e/pages/6-2-adjusting-nominal-values-to-real-values.
3. in = trillions, c = 14, i = 3.6, g = 3.9, x = 2.1, m = 2.7, pop = 334,000,000 gives perPerson = $62,574.85, cShare = 66.985646%. Source: OpenStax, Principles of Macroeconomics 3e, §6.1, Table 6.1, https://openstax.org/books/principles-macroeconomics-3e/pages/6-1-measuring-the-size-of-the-economy-gross-domestic-product.

## FAQ

### How do you calculate GDP?

By the expenditure approach, GDP = C + I + G + (X − M): consumption plus investment plus government spending plus exports minus imports. With OpenStax’s U.S. figures (trillions of dollars), 14.0 + 3.6 + 3.9 + (2.1 − 2.7) = 20.9.

### What is GDP?

The BEA defines it as the value of the final goods and services produced in the United States. Only final goods count, so the steel in a new car is not counted twice.

### Why are imports subtracted?

Consumption, investment and government spending include goods made abroad. Subtracting imports takes them out, so GDP counts only what was produced at home. Exports are made at home but bought abroad, so they are added.

### What is the difference between nominal and real GDP?

Nominal (current-dollar) GDP uses the prices of the year measured. Real GDP removes inflation by dividing by a price index: real GDP = nominal GDP ÷ (deflator ÷ 100). OpenStax’s example: 1960 nominal GDP of $542.4 billion with a deflator of 16.6 is $3,267.5 billion in base-year dollars.

### How do I find GDP per person?

Divide GDP in dollars by the population. $20.9 trillion shared by 334 million people is about $62,575 each.

### Where do I find the numbers?

In the national accounts. For the United States, the Bureau of Economic Analysis (BEA) publishes GDP and its parts each quarter. Type them here in one unit, for example billions of dollars.

## Sources

- U.S. Bureau of Economic Analysis (BEA), Gross Domestic Product (the value of the final goods and services produced in the United States; current-dollar or nominal vs. real or chained estimates). https://www.bea.gov/resources/learning-center/what-to-know-gdp (retrieved 2026-10-02)
- OpenStax, Principles of Macroeconomics 3e, §6.1 Measuring the Size of the Economy: Gross Domestic Product (GDP = C + I + G + (X − M); Table 6.1 Components of U.S. GDP: consumption $14.0, investment $3.6, government $3.9, exports $2.1, imports −$2.7, total $20.9 trillion). https://openstax.org/books/principles-macroeconomics-3e/pages/6-1-measuring-the-size-of-the-economy-gross-domestic-product (retrieved 2026-10-02)
- OpenStax, Principles of Macroeconomics 3e, §6.2 Adjusting Nominal Values to Real Values (real GDP = nominal GDP ÷ (price index ÷ 100); 1960: $542.4 billion, deflator 16.6, real GDP $3,267.5 billion). https://openstax.org/books/principles-macroeconomics-3e/pages/6-2-adjusting-nominal-values-to-real-values (retrieved 2026-10-02)
