Use this free GDP calculator to work out gross domestic product using the expenditure approach, GDP = C + I + G + (X − M). Enter consumption, investment, government spending, exports and imports, and add a deflator to see real GDP as well.

GDP Calculator

Build GDP from its real components — consumption, investment, government spending and net exports — and strip out inflation with a deflator.

Free to use Expenditure approach Real GDP via deflator Net exports shown

Enter your values

Fill in the fields below — the result appears with every step shown.

Shown on the printed, PDF and PNG copies of your result. Leave blank to stay anonymous.

Enter a valid value for consumption c.

Household spending on goods and services, in billions.

Enter a valid value for investment i.

Business investment, housing and inventory change, in billions.

Enter a valid value for government spending g.

Government consumption and investment (transfer payments excluded), in billions.

Enter a valid value for exports x.

Goods and services sold abroad, in billions.

Enter a valid value for imports m.

Goods and services bought from abroad, in billions.

Enter a valid value for gdp deflator (optional).

Leave at 100 for nominal GDP only; above 100 also gives real GDP.

Local browser calculation

Review your inputs and the tool’s supported scope before using the result.

Calculator loading… If this message stays, this view is not running the calculator's script — open this file in a full browser tab, then press Calculate.

Your result will appear here

Enter your values above, then press Calculate — or press Enter in any field.
TinyExe GDP Calculator tinyexe.comFree online calculators

TinyExe · GDP Result

Calculated locally in your browser

Calculated on
—

–
—

Name

—

Consumption C

—

Investment I

—

Government spending G

—

How this was calculated

    What to do next

      TinyExe · tinyexe.com — Runs 100% in your browser — your numbers never leave this tab; nothing is uploaded or stored.

      TinyExe PDF & PNG exports carry the TinyExe logo and tinyexe.com header & footer.

      Runs 100% in your browser — your numbers never leave this tab; nothing is uploaded or stored.

      Embed this tool

      Add this GDP Calculator to your own page — copy the code below and paste it where you want the tool to appear.

      The embed loads the live calculator in a frame, so it stays up to date automatically. Choose a width, check the code, then copy it. When you publish on WordPress, keep the src pointing at your live tool URL.

      Works in WordPress (Custom HTML block), HTML pages, and most site builders.

      The short answer

      Gross domestic product by the expenditure approach equals consumption plus investment plus government spending plus net exports. If consumption is 14,000, investment 3,600, government 3,400 and net exports minus 900, GDP is 20,100 billion; at a deflator of 120, real GDP is 16,750 billion.

      • GDP = C + I + G + (X - M) is the expenditure approach
      • Imports are subtracted because C, I and G already contain them
      • Real GDP = nominal GDP / deflator x 100 removes price changes

      GDP components at a glance

      Reference values for this calculator.

      ComponentSymbolCounts
      ConsumptionCHousehold spending
      InvestmentIBusiness + housing + inventories
      GovernmentGGovt purchases (not transfers)
      Net exportsX - MExports minus imports

      The formula

      The exact formula this calculator uses — every variable in it is explained in the card below.

      The formula

      Expenditure approach: GDP = C + I + G + (X - M) ; Real GDP = Nominal GDP / GDP deflator x 100

      Ideas enhancement over the old generic arithmetic kernel: builds GDP from its five real expenditure components, reports net exports and the consumption share, and converts to real GDP when you supply a deflator — the nominal-versus-real distinction the search queries actually ask about.

      Worked examples

      Worked examples with the full working shown — try them in the calculator to check.

      Example 1

      Large economy with a trade deficit

      C 14,000; I 3,600; G 3,400; X 3,000; M 3,900; deflator 120

      CalculationSteps
      Net exports = 3,000 - 3,900 = -900. GDP = 14,000 + 3,600 + 3,400 - 900 = 20,100. Real GDP = 20,100 / 120 x 100 = 16,750.Nominal GDP 20,100 billion; real GDP 16,750 billion.

      Result

      Example 2

      Balanced trade

      C 500; I 120; G 180; X 200; M 200; deflator 100

      CalculationSteps
      Net exports = 0. GDP = 500 + 120 + 180 + 0 = 800. Real = nominal at deflator 100.GDP 800 billion, nominal and real identical.

      Result

      Example 3

      Small open economy

      C 60; I 15; G 12; X 40; M 28; deflator 110

      CalculationSteps
      Net exports = 12. GDP = 60 + 15 + 12 + 12 = 99. Real GDP = 99 / 110 x 100 = 90.Nominal GDP 99 billion; real GDP 90 billion.

      Result

      How to use this calculator

      Step 1

      Enter household consumption C in billions.

      Step 2

      Enter investment I and government spending G.

      Step 3

      Enter exports X and imports M.

      Step 4

      Optionally set the GDP deflator to also get real GDP.

      Step 5

      Read nominal GDP, net exports and the real figure.

      In short: Gross domestic product is the total market value of all final goods and services produced within a country during a given period.

      Frequently asked questions

      What is the GDP formula?

      By the expenditure approach, GDP = C + I + G + (X − M): consumption plus investment plus government spending plus net exports. It counts the market value of all final goods and services produced inside a country in a period.

      How do I calculate real GDP?

      Divide nominal GDP by the GDP deflator and multiply by 100. With nominal GDP of 20,100 and a deflator of 120, real GDP is 16,750 — the same output valued at base-year prices, with inflation removed.

      Why are imports subtracted?

      C, I and G include spending on imported goods, which is foreign production, not domestic. Subtracting M removes that foreign content so GDP measures only what was produced at home; exports are added because foreigners buy domestic output.

      Do government transfer payments count in G?

      No. Pensions and benefits are transfers, not purchases of goods or services, so they are excluded from G. They enter GDP only when recipients spend them, as consumption.

      What is the difference between nominal and real GDP?

      Nominal GDP uses current prices, so it rises with inflation even if output is flat. Real GDP uses base-year prices via the deflator, so its growth reflects actual extra production.

      About this calculator

      A GDP calculator adds up the expenditure approach to gross domestic product: everything households consume, businesses invest, governments purchase, and foreigners net-buy from the economy, in one figure for a quarter or a year.

      GDP is the market value of all final goods and services produced inside a country's borders in a period. 'Final' matters: the flour sold to a bakery is not counted separately, because its value is already inside the price of the bread — counting both would double-count production. The expenditure approach reaches the total by following the money: GDP = C + I + G + (X − M).

      Imports confuse beginners because they are subtracted. The reason is accounting, not hostility to trade: consumption, investment and government spending all include imported goods, so without subtracting M the total would credit foreign factories for domestic spending. Net exports can be negative — the first worked example has a 900 billion deficit — and GDP simply absorbs that.

      Nominal GDP is measured at today's prices, so it can grow while nothing extra is produced. Real GDP divides by the GDP deflator, an economy-wide price index set to 100 in a base year. A deflator of 120 means prices are 20% above base year, and real GDP of 16,750 against nominal 20,100 shows the output that growth actually bought.

      Use it for economics coursework, checking a country's published accounts component by component, comparing how much of an economy is consumption versus investment, and converting a headline nominal figure into inflation-adjusted real GDP with a deflator.

      How to calculate it yourself

      Step 1

      Add household consumption C.

      Step 2

      Add business and housing investment I.

      Step 3

      Add government purchases G, excluding transfer payments.

      Step 4

      Subtract imports M from exports X to get net exports, then add that too.

      Step 5

      For real GDP, divide the nominal total by the deflator and multiply by 100.

      Real-life examples

      Student checking a textbook economy

      A student is given an economy with consumption 700, investment 180, government spending 220, exports 150 and imports 170, and asked for GDP and the trade balance.

      Net exports = 150 - 170 = -20. GDP = 700 + 180 + 220 - 20 = 1,080.

      GDP is 1,080 billion with a 20 billion trade deficit.

      Analyst removing inflation

      A commentator notes nominal GDP rose from 20,100 to 21,105 while the deflator rose from 120 to 126, and asks whether the economy actually grew.

      Real GDP before = 20,100 / 120 x 100 = 16,750. Real GDP after = 21,105 / 126 x 100 = 16,750. Output is unchanged; all of the nominal rise was prices.

      Real growth is zero despite a 5% nominal rise.

      Ideas & use cases

      • Structure comparison: run two countries with the same GDP and compare the consumption share in the details to see how different the economies feel.
      • Deficit sensitivity: hold everything else fixed and raise imports to see exactly how much a wider trade deficit subtracts from GDP.
      • Inflation illusion test: raise nominal GDP and the deflator by the same percentage and confirm real GDP does not move.

      Limitations & sources

      • One approach only (expenditure); it does not compute GDP by the income or production approaches, per-capita figures, growth rates between periods, or purchasing-power-parity adjustments.

      Sources: Expenditure approach and GDP deflator definitions: U.S. Bureau of Economic Analysis (BEA) national accounts concepts; calculator.net gdp-calculator cross-checked

      GDP Calculator · TinyExe calculator suite Free to use · No sign-up · Instant results