Skip to content
CalculatorAtlas

GDP Calculator

Tested

Gross domestic product by the expenditure approach.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

GDP by the expenditure approach = C + I + G + (X − M): consumption, investment, government spending and net exports. 12,000 + 3,000 + 4,000 + (2,500 − 2,000) = 19,500.

Enter consumption, investment, government spending, exports and imports. The calculator returns GDP and net exports.

Related tools: Price Elasticity of Demand Calculator: Price elasticity of demand by the midpoint (arc) method. Marginal Cost Calculator: Extra cost of producing additional units. Marginal Revenue Calculator: Extra revenue from selling additional units.

How to use the GDP Calculator

  1. Enter consumption (C) (0 or more).
  2. Enter investment (I) (0 or more).
  3. Enter government spending (G) (0 or more).
  4. Enter exports (X) (0 or more).
  5. Enter imports (M) (0 or more).
  6. Press Calculate to see the result, and use Reset to start again.
Inputs of the GDP Calculator
InputWhat to enterAllowed values
Consumption (C)A number≥ 0
Investment (I)A number≥ 0
Government spending (G)A number≥ 0
Exports (X)A number≥ 0
Imports (M)A number≥ 0

Formula and method

Formula

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

IEEE-754 double precision; shown to the decimals indicated.

Use one currency and period for all components.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Consumption (C) = 12000; Investment (I) = 3000; Government spending (G) = 4000; Exports (X) = 2500; Imports (M) = 2000.

Results of example 1
ResultValue
GDP19,500
Net exports500

Example 2

Inputs: Consumption (C) = 500; Investment (I) = 100; Government spending (G) = 150; Exports (X) = 80; Imports (M) = 120.

Results of example 2
ResultValue
GDP710
Net exports-40

The first line is the headline result (gDP). Below it the gDP Calculator lists net exports, which describe the same case from other angles. IEEE-754 double precision; shown to the decimals indicated.

The four components

Consumption is household spending, investment is business capital spending and housing, government is public purchases, and net exports is exports minus imports. Transfer payments such as pensions are not government spending in this identity.

Nominal versus real

This gives nominal GDP in the units you enter. To compare across years, adjust for price changes to get real GDP. Net exports can be negative when imports exceed exports.

How the result changes with consumption

Holding every other input at the first worked example, this table changes only consumption. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with consumption
ConsumptionGDPNet exports
600013,500500
1200019,500500
2400031,500500
4800055,500500

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Consumption (C): left empty shows "Enter consumption (c)." beside that field and no result.
  • Imports (M): entering "-1" shows "Imports (M) must be at least 0." beside that field and no result.

Choosing between the GDP Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the GDP Calculator and similar calculators
CalculatorYou enterIt returns
[Price Elasticity of Demand Calculator](/business/price-elasticity-demand/)price before, price after and quantity beforePrice Elasticity of Demand
[Marginal Cost Calculator](/business/marginal-cost/)total cost before, total cost after and quantity beforeMarginal cost
[Marginal Revenue Calculator](/business/marginal-revenue/)total revenue before, total revenue after and quantity beforeMarginal revenue
[Opportunity Cost Calculator](/business/opportunity-cost/)return of the option you gave up and return of the option you choseOpportunity cost
[Income Elasticity of Demand Calculator](/business/income-elasticity-demand/)income before, income after and quantity beforeIncome Elasticity of Demand

Background: business metrics

Business ratios depend on exactly which costs and revenues you include, so read each page's definition. Two common checks: break-even units = fixed costs ÷ (price − variable cost per unit), so $50,000 of fixed costs with a $10 price and $5 variable cost breaks even at 10,000 units; and net profit margin = net profit ÷ revenue, so $20,000 profit on $100,000 revenue is 20%.

Return on investment ignores time: 20% over five years is far less impressive than 20% in one, so compare returns over the same period.

Assumptions and limitations

  • Net exports can be negative

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for consumption (C) and imports (M) to confirm this.

Frequently asked questions

Does GDP measure well-being?

Not directly; it measures output.

Why subtract imports?

Imports are included in the other spending categories but were not produced domestically.

What is GDP per capita?

GDP divided by population.

What does the GDP Calculator calculate?

Gross domestic product by the expenditure approach. It returns GDP and Net exports.

What formula does the GDP Calculator use?

GDP = C + I + G + (X − M). Use one currency and period for all components.

What do I need to enter in the gDP Calculator?

You enter Consumption (C), Investment (I), Government spending (G), Exports (X) and Imports (M).

How is the result rounded or limited?

IEEE-754 double precision; shown to the decimals indicated. Net exports can be negative.

What is an example of a gDP result?

With consumption (C) 12000, investment (I) 3000, government spending (G) 4000, exports (X) 2500 and imports (M) 2000, the gDP is 19,500.

Where does the method come from?

The method follows: Expenditure approach to national accounts (e.g. UN System of National Accounts).

Sources

  • Expenditure approach to national accounts (e.g. UN System of National Accounts)

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.