GDP Calculator — Expenditure, Real GDP, Deflator & Output Gap
Compute GDP from C + I + G + X − M, convert nominal to real GDP with the deflator, and measure growth, the output gap, and sector shares using the BEA framework.
Macroeconomic GDP Output Engine
A clear path from inputs to results.
Build GDP from its spending components, convert it from nominal to real using the price deflator, and read growth, the output gap, and each sector's share. The engine follows the BEA expenditure identity GDP = C + I + G + X − M and the implicit price deflator, with a production-approach extension that adds taxes less subsidies.
How to use
- Enter the four demand components and imports: consumption (C), investment (I), government spending (G), exports (X), and imports (M). The tool sums them into nominal GDP as C + I + G + X − M.
- Set the GDP deflator (a price index where 100 is the base year); real GDP is nominal GDP divided by deflator ÷ 100.
- Enter potential output (Y*) to measure the output gap — how far actual real GDP sits above or below the economy's sustainable level.
- Set per-quarter growth rates for each component and the deflator; the engine implies the prior quarter's real GDP from these and reports quarter-on-quarter and annualized growth.
- Add taxes less subsidies to see the production-approach GDP (gross value added plus product taxes).
- Use the projection horizon and the 2D paths plus the 3D consumption-versus-investment surface to explore how the components drive real GDP and the output gap.
The formula
Reference: US Bureau of Economic Analysis (BEA) expenditure approach and implicit GDP price deflator; World Bank production (value-added) approach; standard annualization of quarterly growth.
Worked example
Open economy, deflator 118, potential output 1,900 (default inputs)
- Consumption C = 1,240; investment I = 450; government G = 420; exports X = 260; imports M = 310; GDP deflator = 118; potential output Y* = 1,900; taxes less subsidies = 85; quarterly growth C 1.2%, I 1.8%, G 1.0%, X 1.3%, M 1.1%, deflator 0.8%.
- 1
Nominal GDP is 1,240 + 450 + 420 + 260 − 310 = 2,060. Dividing by the deflator (118 ÷ 100 = 1.18) gives real GDP of 2,060 ÷ 1.18 = 1,745.76 in base-year prices. The prior quarter is implied by deflating each current component by its growth rate (for example 1,240 ÷ 1.012) and dividing by the lagged deflator, which gives a prior real GDP of 1,736.85; the quarter-on-quarter growth is therefore (1,745.76 − 1,736.85) ÷ 1,736.85 = 0.5131%, which annualizes to (1.005131)^4 − 1 = 2.07%. The output gap is (1,745.76 − 1,900) ÷ 1,900 × 100 = −8.12%. Consumption's share is 1,240 ÷ 2,060 = 60.19% and net exports are (260 − 310) ÷ 2,060 = −2.43%. Adding taxes less subsidies gives the production-approach GDP of 2,060 + 85 = 2,145.
Nominal GDP 2,060; real GDP 1,745.76; QoQ growth 0.51% (2.07% annualized); output gap −8.12%; consumption 60.19% and net exports −2.43% of GDP; production-approach GDP 2,145.
Interpreting the result
Nominal GDP is measured in current prices; dividing by the deflator strips out inflation so real GDP is comparable across periods. A negative output gap of −8.12% means actual output is running well below potential, the signature of economic slack. The component shares show the economy is consumption-led (60%) with a trade deficit (net exports −2.4%), and the gap between quarterly and annualized growth shows how a modest 0.51% quarterly pace compounds to about 2.1% a year.
Assumptions & limitations
- The prior-period GDP used for the growth rate is implied by deflating the current components by their entered growth rates, not taken from separate historical data; growth therefore reflects your assumed component growth, not an actual lagged observation.
- Each component grows at a constant quarterly rate over the projection horizon; the model is deterministic and does not include shocks, feedback, or behavioral responses.
- The deflator is an index you supply; the tool does not derive it from a separate basket of current and chained-dollar values, so real GDP is only as accurate as the deflator you enter.
- The production-approach figure is a simplified extension (nominal GDP plus taxes less subsidies) rather than a bottom-up sum of industry gross value added.
- Potential output Y* is an input, not estimated from a production function or trend filter, so the output gap depends entirely on the Y* you choose.
Frequently asked questions
What is the difference between nominal and real GDP?
Nominal GDP values output at current prices, so it rises with both quantity and inflation. Real GDP removes price changes by dividing nominal GDP by the deflator ÷ 100. With a deflator of 118, prices are 18% above the base year, so nominal GDP of 2,060 corresponds to real GDP of 2,060 ÷ 1.18 = 1,745.76 in base-year terms.
What does a negative output gap mean?
The output gap is (real GDP − potential GDP) ÷ potential GDP. A negative value, like the −8.12% here, means the economy is producing below its sustainable potential — a sign of unused capacity, higher unemployment, and disinflationary pressure. A positive gap would signal an overheating economy running above potential.
How is annualized growth different from quarterly growth?
Annualized growth compounds the quarterly rate as if it continued for four quarters: (1 + QoQ)^4 − 1. A 0.51% quarterly rate becomes (1.005131)^4 − 1 = 2.07% a year. This is the convention the BEA uses to report headline GDP growth, so a single strong quarter is scaled up to an annual pace.
How does the expenditure identity GDP = C + I + G + X − M work?
It adds the four sources of spending on domestic output — household consumption, business investment, government purchases, and exports — and subtracts imports, which are spending on foreign output. For the defaults that is 1,240 + 450 + 420 + 260 − 310 = 2,060. Imports are subtracted because they are already embedded in the other components.
Why is net exports negative?
Net exports are exports minus imports, (260 − 310) = −50, which is −2.43% of GDP. A negative figure is a trade deficit: the economy imports more than it exports, so foreign trade is a net drag on measured domestic demand in this period.
What is the production (value-added) approach shown here?
It is an alternative way to measure the same GDP: instead of summing expenditure, it sums the gross value added by all producers and adds taxes less subsidies on products. The tool implements a simplified version — nominal GDP plus the taxes-less-subsidies you enter, giving 2,060 + 85 = 2,145 — to illustrate how the output and expenditure approaches reconcile.
Methodology last reviewed 2026-10-06. Results are informational and not financial or engineering advice — see our disclaimer.