GDP Calculator
Enter consumption, investment, government spending, exports and imports to get GDP by the expenditure approach. Add a GDP deflator for real GDP and a population for GDP per capita.
Base year = 100. Leave empty to skip real GDP.
Number of people. Leave empty to skip per capita.
How to use the GDP Calculator
- Pick a starting point. "From C + I + G + (X − M)" builds GDP from its spending parts. "From nominal GDP" is for when you already have the total.
- Choose the unit your figures are in, such as billions, and enter every amount in that same unit.
- Enter the GDP deflator for the year, where the base year is 100, and the population. Leave either field empty to skip that result.
- Press Calculate GDP to see nominal GDP, real GDP and GDP per capita. Starting from the components, you also get net exports and each part's share of GDP.
How to calculate GDP
GDP = C + I + G + (X − M) · · · Real GDP = Nominal GDP ÷ Deflator × 100 · · · GDP per capita = GDP ÷ Population
The expenditure approach adds up all spending on final goods and services produced inside a country during a period. C is household consumption, I is investment, G is government purchases, X is exports and M is imports. Imports come off because C, I and G already include spending on foreign-made goods, which the country did not produce. When imports exceed exports, X − M is negative and the formula subtracts it from C + I + G.
Worked example with a trade deficit
Take an economy with consumption of $15,000 billion, investment of $4,000 billion, government spending of $4,000 billion, exports of $3,000 billion and imports of $4,000 billion. Net exports are 3,000 − 4,000 = −$1,000 billion, a trade deficit. GDP = 15,000 + 4,000 + 4,000 − 1,000 = $22,000 billion, or $22 trillion. With a GDP deflator of 110, real GDP is 22,000 ÷ 110 × 100 = $20,000 billion in base-year prices. Spread over 330 million people, nominal GDP per capita comes to about $66,667 and real GDP per capita to about $60,606. These are the calculator's default values, so pressing the button reproduces every step.
What goes into each part of the GDP formula
GDP counts final goods and services only. Steel sold to a carmaker doesn't count on its own, because its value is already inside the price of the car. GDP also leaves out used goods and financial trades such as buying shares, since nothing new was produced.
Consumption (C)
Household spending on goods and services: groceries, rent, haircuts, cars and medical care. In most large economies it is the biggest of the four parts. New houses are the exception, because GDP counts them as investment.
Investment (I)
Business spending on equipment, software and buildings, plus new home construction and the change in business inventories. A company buying shares or bonds is not investment in the GDP sense. The inventory change turns negative in a year when firms sell more than they produce.
Government spending (G)
What federal, state and local governments pay for goods and services, from public salaries to roads and military equipment. Transfer payments such as Social Security and unemployment benefits are not part of G. They move money without buying anything, and they show up in C once households spend them.
Net exports (X − M)
Exports are goods and services made at home and sold abroad. Imports are made abroad and bought at home. A negative result means a trade deficit. Subtracting imports does not mean imports shrink the economy. It removes the foreign-made goods that C, I and G already counted.
Nominal and real GDP
Nominal GDP uses each year's own prices, so it rises with inflation even when output stays flat. Real GDP restates it in base-year prices by dividing by the GDP deflator and multiplying by 100. A deflator of 110 means prices are 10% above the base year, so nominal GDP of 22,000 becomes real GDP of 20,000. Use real GDP to compare growth across years.
GDP per capita
GDP divided by population gives output per person, which lets you compare a country of 5 million with one of 300 million. It is an average and says nothing about how income is split between households. The calculator converts your chosen unit before dividing, so 22,000 billion over 330 million people gives about 66,667 per person.
Frequently asked questions
How do you calculate GDP?
With the expenditure approach, add consumption, investment and government spending, then add exports and subtract imports: GDP = C + I + G + (X − M). For C = 800, I = 200, G = 300, X = 500 and M = 400, net exports are 100 and GDP is 800 + 200 + 300 + 100 = 1,400.
Why are imports subtracted in the GDP formula?
Consumer, business and government spending all include purchases of foreign-made goods. GDP measures production inside the country, so the formula takes imports back out. An imported $30,000 car adds $30,000 to C and subtracts $30,000 through M, which leaves GDP unchanged.
Can net exports be negative?
Yes. When a country imports more than it exports, X − M is negative and the formula subtracts it from C + I + G. The calculator labels this a trade deficit. In the default example, exports of 3,000 and imports of 4,000 give net exports of −1,000.
What is the difference between nominal and real GDP?
Nominal GDP uses current prices. Real GDP removes price changes by dividing nominal GDP by the GDP deflator and multiplying by 100. If nominal GDP grows 5% in a year while the deflator rises 3%, real GDP grew about 2%.
Which GDP deflator should I use?
Use the deflator for the year your nominal figure comes from, on the same base year as the real figures you want to compare. In the US, the Bureau of Economic Analysis publishes an implicit price deflator for GDP with its GDP estimates. If your year is the base year, enter 100 and real GDP equals nominal GDP.