Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

GDP Calculator (Gross Domestic Product, Expenditure and Income Approach)

Choose the approach (expenditure or income) and enter the amount of each part. Blank fields count as 0. Any unit works, but for US GDP, trillions of dollars is a good choice.

Enter numbers only. Negative values are allowed (for example, a drop in inventories or imports larger than exports).
Result and graph
Enter amounts such as consumption and investment in the fields on the left and press "Calculate". The result and a graph will appear here.

What you can do on this page

  • Enter just five amounts, consumption, investment, government spending, exports and imports, to find GDP (gross domestic product) with the expenditure formula \(\mathrm{GDP} = C + I + G + (X - M)\) (the standard formula from economics class and AP Macroeconomics)
  • Switch to "From income" to find GDP from compensation of employees, operating surplus and mixed income, consumption of fixed capital, and taxes less subsidies, the categories of the national accounts (the same ones the US Bureau of Economic Analysis, BEA, uses for gross domestic income)
  • Net exports (exports − imports) are calculated at the same time, and a horizontal bar chart shows at a glance which parts make up GDP (negative net exports appear as a bar pointing left)
  • Blank fields count as 0, so you can also quickly add up just the parts you know
  • A plain-language explanation of the formulas, why the approaches give the same GDP, the difference between nominal and real GDP, and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
You can use any unit for the amounts (for US GDP, trillions of dollars works well). Just enter every part in the same unit.

What is this calculation used for?

Studying for economics class and AP Macroeconomics (learning)

"GDP = C + I + G + (X − M)" is a formula you meet again and again, from high school economics to AP Macroeconomics and college principles courses. Questions such as "calculate GDP from the table" or "what happens to GDP when net exports are negative?" can be solved just by plugging the numbers into this formula.
Learning it together with the idea that GDP measured from production, income or spending gives the same value also prepares you for questions on the income side (compensation of employees, operating surplus and so on).

Understanding GDP news and economic growth rates

The BEA's quarterly GDP release is reported part by part, just like this formula: "consumer spending slowed", "business investment picked up". Knowing the formula, you can tell whether growth was driven by consumers or by exports. Note that US quarterly growth rates are annualized.
You can also get a sense of scale for "real GDP grew 2%". With US GDP at about $29.3 trillion, 2% is \(29.3 \times 0.02 \approx 0.59\) trillion dollars, about $590 billion more production in a year.

A yardstick for "X% of GDP" in policy news

The size of policies such as defense spending, education spending and government debt is usually described internationally as a "percent of GDP". Knowing that GDP is the denominator, you can convert it yourself: for example, NATO's guideline of spending "2% of GDP" on defense is about \(29.3 \times 0.02 \approx 0.59\) trillion dollars for the US.
This formula is the basis for making sense of huge numbers by comparing them with the size of the whole economy.

Comparing countries in reports and projects (GDP per capita)

Reports that compare how well off countries are usually use GDP per capita, GDP divided by the population, rather than GDP itself. A large economy can still have modest income per person if the population is large.
It also helps to know that comparisons of nominal values are affected by exchange rates, so GDP per capita adjusted for purchasing power parity (PPP) is often used. This keeps you from misreading the data.

Putting a company or industry in the context of the whole economy (business)

A sense of scale such as "US consumer spending is about $19.9 trillion" and "investment (equipment, housing and inventories) is about $5.3 trillion" is a starting point for estimating market sizes or explaining where an industry stands in a business plan.
For example, a "$1 trillion market" is about \(1 \div 19.9 \approx 5\%\) of all US consumer spending, a huge market, which you can feel by comparing it with the parts of the formula.

Formulas and graphs

GDP from spending (expenditure approach)
Graph
Standard notation (the usual math form)
\(\mathrm{GDP}\) \(=\) \(C\) \(+\) \(I\) \(+\) \(G\) \(+\) \((\) \(X\) \(-\) \(M\) \()\)
In words (symbols replaced with words)
⑥ \(\mathrm{GDP}\): gross domestic product \(=\) ① \(C\): consumption \(+\) ② \(I\): investment \(+\) ③ \(G\): government spending \(+\) \((\) ④ \(X\): exports \(-\) ⑤ \(M\): imports \()\)
The formula in words
① Add up \(C\): consumption (household spending) ,
② \(I\): investment (business equipment and so on) and
③ \(G\): government spending (government consumption and investment) , then add net exports, the
④ \(X\): exports minus the
⑤ \(M\): imports , and you get the
⑥ \(\mathrm{GDP}\): gross domestic product
Quick example
For a model economy about the size of a mid-sized country (in billions of dollars) with consumption 335, investment 145, government spending 160, exports 140 and imports 145, GDP is
\(\mathrm{GDP}\): gross domestic product \(=\) consumption (335) \(+\) investment (145) \(+\) government spending (160) \(+\) \((\) exports (140) \(-\) imports (145) \()\)
\(140 - 145 = -5\)
\(335 + 145 + 160 + (-5) = 635\)
Key idea
Only "exports − imports" (net exports) is a subtraction because consumption and investment also include spending on imported goods made in other countries. Imports are not produced at home, so all imports are subtracted at the end to avoid counting value created abroad as part of your own country's GDP. In a year with more imports than exports, net exports are negative (in fact, US net exports in 2024 were about −$0.9 trillion: about $3.2 trillion of exports minus about $4.1 trillion of imports). Textbooks sometimes group investment and government spending a little differently (for example, where government investment goes), but the idea of counting every part exactly once is the same.
GDP from income (income approach, national accounts categories)
Graph
Standard notation (the usual math form)
\(\mathrm{GDP}\) \(=\) \(W\) \(+\) \(\mathit{OS}\) \(+\) \(D\) \(+\) \((\) \(T\) \(-\) \(S\) \()\)
In words (symbols replaced with words)
⑥ \(\mathrm{GDP}\): gross domestic product \(=\) ① \(W\): compensation of employees \(+\) ② \(\mathit{OS}\): operating surplus and mixed income \(+\) ③ \(D\): consumption of fixed capital \(+\) \((\) ④ \(T\): taxes \(-\) ⑤ \(S\): subsidies \()\)
The formula in words
① Add up \(W\): compensation of employees (the pay workers receive) ,
② \(\mathit{OS}\): operating surplus and mixed income (business profits and self-employment income) and
③ \(D\): consumption of fixed capital (wear and tear on buildings and equipment) , then add the
④ \(T\): taxes on production and imports (such as sales taxes) minus the
⑤ \(S\): subsidies , and you get the
⑥ \(\mathrm{GDP}\): gross domestic product
Quick example
For the same model economy (in billions of dollars) with compensation of employees 310, operating surplus and mixed income 100, consumption of fixed capital 175, taxes on production and imports 57 and subsidies 7, GDP is
\(\mathrm{GDP}\): gross domestic product \(=\) compensation of employees (310) \(+\) operating surplus (100) \(+\) consumption of fixed capital (175) \(+\) \((\) taxes (57) \(-\) subsidies (7) \()\)
\(57 - 7 = 50\)
\(310 + 100 + 175 + 50 = 635\)
Key idea
This breakdown follows the national accounts (the international System of National Accounts, SNA). In the US, the Bureau of Economic Analysis (BEA) publishes gross domestic income (GDI) in these same categories. The value added by production is split by who receives it: workers' income (compensation of employees), the profits of businesses and self-employed people (operating surplus and mixed income), the wear and tear on equipment (consumption of fixed capital), and the taxes that go to the government (minus subsidies). US textbooks sometimes list more detailed items, such as proprietors' income, corporate profits, rental income and net interest. In the national accounts these are all parts of the operating surplus and mixed income. Whichever approach you use, you get the same GDP in theory. In real statistics there is a small gap from different data sources (the statistical discrepancy): for the US in 2024, GDI was about $29.0 trillion and GDP about $29.3 trillion.
Net exports
Graph
Standard notation (the usual math form)
\(\mathit{NX}\) \(=\) \(X\) \(-\) \(M\)
In words (symbols replaced with words)
③ \(\mathit{NX}\): net exports \(=\) ① \(X\): exports \(-\) ② \(M\): imports
The formula in words
① Take the \(X\): exports (sold to other countries)
② subtract the \(M\): imports (bought from other countries)
③ and you get the \(\mathit{NX}\): net exports
Quick example
With exports of $140 billion and imports of $145 billion, net exports are
\(\mathit{NX}\): net exports \(=\) exports (140) \(-\) imports (145)
\(140 - 145 = -5\)
Key idea
Negative net exports (a trade deficit) are not unusual; the US has had one every year for decades. A negative value means the country bought more from other countries than it sold to them, and the GDP formula subtracts that amount from the total. In the graphs on this page, negative net exports are shown as a bar pointing left.
GDP is found with simple addition and subtraction - consumption + investment + government spending + net exports (exports − imports). Calculating from the income side (compensation of employees + operating surplus and mixed income + consumption of fixed capital + taxes − subsidies) gives the same value in theory, because every dollar spent on what is produced becomes someone's income.

Symbols and terms

Symbols

\(\mathrm{GDP}\) G D P Gross domestic product. The total value added of all goods and services produced within the country in a period (a quarter or a year).
\(C\) C Consumption. Total household spending on goods and services (personal consumption expenditures, PCE, in US statistics).
\(I\) I Investment. Business spending on equipment and buildings, plus residential investment (new homes) and the change in inventories (gross private domestic investment in US statistics). In a year when inventories fall, the change in inventories is negative.
\(G\) G Government spending. Government consumption (public services and so on) plus government investment. Transfer payments such as Social Security benefits are not spending on production, so they are not included.
\(X\) X Exports (from "eXport"). Total goods and services sold to other countries.
\(M\) M Imports (from "iMport"). Total goods and services bought from other countries. They are not produced at home, so they are subtracted at the end of the formula.
\(\mathit{NX}\) N X Net exports. Exports minus imports (\(X - M\)); it can be negative.
\(W\) W Compensation of employees (from "wages"). Wages, salaries and bonuses paid to workers, plus employer contributions such as social insurance.
\(\mathit{OS}\) O S Operating surplus and mixed income. Business profits (operating surplus) plus the income of self-employed people (mixed income).
\(D\) D Consumption of fixed capital (from "depreciation"). The loss in value of buildings, machines and other capital as they wear out.
\(T\) T Taxes on production and imports, such as sales taxes, excise taxes and customs duties.
\(S\) S Subsidies paid by the government to businesses and others. In the income approach they are subtracted from taxes.

Terms

GDP (gross domestic product) The total value added of all goods and services produced within the country in a period (a quarter or a year). It is the most widely used measure of the size of an economy. In the US it is published by the Bureau of Economic Analysis (BEA).
value added The new value created by production - sales minus the cost of materials and other inputs. GDP adds up value added across the whole country. If you simply added a bakery's sales to the farmer's sales, the wheat would be counted twice, so only the value added at each step is counted.
three approaches to GDP GDP can be measured from production (value added), from income or from spending, and in theory all three give the same value, because what someone produces becomes someone's income and is bought with someone's spending. (Real statistics show a small gap from different data sources, called the statistical discrepancy.)
GNI (gross national income) The total income earned by a country's residents, rather than what is produced within its borders. It is GDP plus net income from abroad (such as interest and dividends on foreign investments), and it used to be called GNP (gross national product). For countries whose companies earn a lot abroad, GNI is larger than GDP.
nominal GDP GDP added up at that year's prices. When prices rise, nominal GDP goes up even if the amount produced stays the same.
real GDP Nominal GDP with the effect of price changes removed. The growth rates in the news, which tell you whether the economy really grew, are normally based on real GDP.
economic growth rate The percentage by which GDP grew from the previous period. "Real GDP grew 2%" means the amount produced, with price effects removed, grew by 2%. In the US, the BEA releases GDP every quarter, and the quarterly growth rate is reported as an annualized rate (the rate it would be if it continued for a whole year).
compensation of employees The wages, salaries and bonuses that employees receive, plus employer contributions such as social insurance. It is the largest part on the income side, about half of US GDP.
operating surplus The profit from businesses' production. On the income side of GDP it is listed next to compensation of employees and mixed income. In US statistics it covers corporate profits, rental income and net interest, among others.
mixed income The income of self-employed people (proprietors' income in the US). It is called mixed because it combines pay for the owner's own work and the profit of the business.
consumption of fixed capital The loss in value of buildings, machines, roads and other capital as they are used and grow old. It is close to depreciation in business accounting, and the "gross" in gross domestic product means this amount is included.
taxes on production and imports Taxes on producing, selling and importing goods and services, such as sales taxes, excise taxes on alcohol and tobacco, customs duties and business property taxes. Market prices include these taxes, so they appear on the income side (income taxes and corporate income taxes are not included here).
net exports Exports minus imports. It shows how much a country earned from trade with other countries, and it is negative in a year with more imports than exports (a trade deficit).
national accounts The system for producing GDP and other economic statistics under common international rules (the System of National Accounts, SNA). In the US, the BEA produces them as the National Income and Product Accounts (NIPA), and the income-side categories on this page follow this system.
GDP per capita GDP divided by the population. Rather than the size of an economy, it is a guide to how well off and productive people are on average, and it is often used to compare countries.
statistical discrepancy The gap between GDP measured from spending and GDI measured from income, caused by differences in the data sources. For the US in 2024 it was about $0.3 trillion, about 1% of GDP.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.

Adding and subtracting positive and negative numbers (Grade 7)
  • Being able to add a negative number, as in \(50 + 20 + 25 + (-5) = 90\) when net exports are negative
  • Knowing that adding a negative number is the same as subtracting that amount
Large numbers and place value (Grades 4–5)
  • Knowing how million, billion and trillion are related (1 trillion = 1,000 billion = 1,000,000 million)
  • Being able to read large amounts such as "$29.3 trillion" without mistakes in place value
Percents (Grade 6)
  • Being able to turn a percent such as "2% of GDP" or "2% growth" into an amount by multiplying
GDP and how it is measured (high school economics)
  • Knowing that GDP is the total value added produced within the country
  • Knowing that measuring GDP from production, income or spending gives the same value

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find GDP from spending
Consumption C 335
Investment I 145
Government spending G 160
Exports X 140
Imports M 145
Net exports (X − M) =B4-B5
GDP (gross domestic product) =B1+B2+B3+B6
Table to find GDP from income
Compensation of employees W 310
Operating surplus and mixed income OS 100
Consumption of fixed capital D 175
Taxes on production and imports T 57
Subsidies S 7
Taxes − subsidies (T − S) =B4-B5
GDP (gross domestic product) =B1+B2+B3+B6
Table to find net exports
Exports X 140
Imports M 145
Net exports NX =B1-B2
After pasting, the upper rows of column B are your inputs and the last rows are calculated automatically. "+" is addition and "-" is subtraction.
In the first table, B6 (net exports) shows -5 and B7 (GDP) shows 635. In the second table, B6 shows 50 and B7 shows 635, and in the third table, B3 shows -5.
Just replace the numbers in column B with your own amounts (all in the same unit).

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find GDP from spending
Consumption C 335
Investment I 145
Government spending G 160
Exports X 140
Imports M 145
Net exports (X − M) =B4-B5
GDP (gross domestic product) =B1+B2+B3+B6
Table to find GDP from income
Compensation of employees W 310
Operating surplus and mixed income OS 100
Consumption of fixed capital D 175
Taxes on production and imports T 57
Subsidies S 7
Taxes − subsidies (T − S) =B4-B5
GDP (gross domestic product) =B1+B2+B3+B6
Table to find net exports
Exports X 140
Imports M 145
Net exports NX =B1-B2
The same formulas as in Excel work as is. Copy the whole table, paste it into cell A1, and replace the numbers in column B with your own.

How to calculate it in Python

# Expenditure approach: GDP = C + I + G + (X - M)   (example unit: billions of dollars)
personal_consumption = 335    # consumption C
private_investment = 145      # investment I
government_spending = 160     # government spending G (government consumption + investment)
exports = 140                 # exports X
imports_value = 145           # imports M ("import" is a Python keyword, so the name is different)

net_exports = exports - imports_value
gdp_expenditure = personal_consumption + private_investment + government_spending + net_exports

# Income approach: GDP = W + OS + D + (T - S)
employee_compensation = 310       # compensation of employees W
operating_surplus = 100           # operating surplus and mixed income OS
fixed_capital_consumption = 175   # consumption of fixed capital D
taxes_on_products = 57            # taxes on production and imports T
subsidies = 7                     # subsidies S

gdp_income = employee_compensation + operating_surplus + fixed_capital_consumption + (taxes_on_products - subsidies)

print(f"Net exports: {net_exports}")
print(f"GDP from spending: {gdp_expenditure}")
print(f"GDP from income: {gdp_income}")
Runs with the standard library only. Change the amounts at the top and run it. If the spending side and the income side give the same value, it matches the principle that the approaches agree.

How to write it in LaTeX and other math languages (copy and paste)

GDP from spending (expenditure approach)
GDP = C + I + G + (X − M)
\mathrm{GDP} = C + I + G + (X - M)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>GDP</mi>
    <mo>=</mo>
    <mi>C</mi>
    <mo>+</mo>
    <mi>I</mi>
    <mo>+</mo>
    <mi>G</mi>
    <mo>+</mo>
    <mrow><mo>(</mo><mi>X</mi><mo>&#x2212;</mo><mi>M</mi><mo>)</mo></mrow>
  </mrow>
</math>
"GDP" = C + I + G + (X - M)
gdp = c + i + g + (x - m)  (* all variables are lowercase because C, I and D are reserved symbols in Mathematica *)
gdp := c + i + g + (x - m);  # all variables are lowercase because I and D are reserved in Maple
GDP = C + I + G + (X - M);
GDP = C + I + G + (X − M)
GDP from income (income approach, national accounts categories)
GDP = W + OS + D + (T − S)
\mathrm{GDP} = W + \mathit{OS} + D + (T - S)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>GDP</mi>
    <mo>=</mo>
    <mi>W</mi>
    <mo>+</mo>
    <mi>OS</mi>
    <mo>+</mo>
    <mi>D</mi>
    <mo>+</mo>
    <mrow><mo>(</mo><mi>T</mi><mo>&#x2212;</mo><mi>S</mi><mo>)</mo></mrow>
  </mrow>
</math>
"GDP" = W + "OS" + D + (T - S)
gdp = w + os + d + (t - s)  (* all variables are lowercase because D, C and I are reserved symbols in Mathematica *)
gdp := w + os + d + (t - s);  # all variables are lowercase because D is the differential operator in Maple
GDP = W + OS + D + (T - S);
GDP = W + OS + D + (T − S)
Net exports
NX = X − M
\mathit{NX} = X - M
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>NX</mi>
    <mo>=</mo>
    <mi>X</mi>
    <mo>&#x2212;</mo>
    <mi>M</mi>
  </mrow>
</math>
"NX" = X - M
nx = x - m  (* lowercase to match the other formulas (N, C, D and I are reserved symbols in Mathematica) *)
nx := x - m;  # lowercase to match the other formulas (D and I are reserved in Maple)
NX = X - M;
NX = X − M

How to have ChatGPT  do the calculation

You are a calculation assistant for economic statistics. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

A country's spending-side figures are: consumption 335, investment 145, government spending 160, exports 140 and imports 145 (all in billions of dollars).
Find each of the following:
1. Net exports (exports − imports)
2. GDP (= consumption + investment + government spending + net exports)
3. The increase in GDP if it grows 2% next year

Show the formulas you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.