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
- Enter consumption (C) (0 or more).
- Enter investment (I) (0 or more).
- Enter government spending (G) (0 or more).
- Enter exports (X) (0 or more).
- Enter imports (M) (0 or more).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed 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.
| Result | Value |
|---|---|
| GDP | 19,500 |
| Net exports | 500 |
Example 2
Inputs: Consumption (C) = 500; Investment (I) = 100; Government spending (G) = 150; Exports (X) = 80; Imports (M) = 120.
| Result | Value |
|---|---|
| GDP | 710 |
| 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.
| Consumption | GDP | Net exports |
|---|---|---|
| 6000 | 13,500 | 500 |
| 12000 | 19,500 | 500 |
| 24000 | 31,500 | 500 |
| 48000 | 55,500 | 500 |
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.
| Calculator | You enter | It returns |
|---|---|---|
| [Price Elasticity of Demand Calculator](/business/price-elasticity-demand/) | price before, price after and quantity before | Price Elasticity of Demand |
| [Marginal Cost Calculator](/business/marginal-cost/) | total cost before, total cost after and quantity before | Marginal cost |
| [Marginal Revenue Calculator](/business/marginal-revenue/) | total revenue before, total revenue after and quantity before | Marginal revenue |
| [Opportunity Cost Calculator](/business/opportunity-cost/) | return of the option you gave up and return of the option you chose | Opportunity cost |
| [Income Elasticity of Demand Calculator](/business/income-elasticity-demand/) | income before, income after and quantity before | Income 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).
Related calculators
- 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.
- Opportunity Cost Calculator — Value given up by choosing one option over another.
- Income Elasticity of Demand Calculator — Income elasticity of demand by the midpoint (arc) method.
- Price Elasticity of Supply Calculator — Price elasticity of supply by the midpoint (arc) method.
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.