Business Finance · Formula v1.0

Cost of Goods Sold (COGS) Calculator

Calculate cost of goods sold from beginning inventory, purchases and ending inventory.

LAST REVIEWEDSeptember 24, 2026Inputs stay in your browser
Live calculation

Enter your numbers

Calculated result
Cost of goods sold$405,000
Goods available for sale$500,000
Sensitivity check

What if beginning inventory changes?

-10% input$397,000
0% input$405,000
+10% input$413,000

Answer first

What this calculator tells you

Calculate cost of goods sold from beginning inventory, purchases and ending inventory. Work out the cost of what you actually sold before you calculate gross profit. Formula: COGS = beginning inventory + purchases − ending inventory. At the worked-example inputs, the cost of goods sold is $405,000. Holding every other input steady, moving beginning inventory from $64,000 to $96,000 moves the result from $389,000 to $421,000.

FreeNo sign-upInputs stay in-browserCSV exportReviewed September 24, 2026

Transparent method

The formula

COGS = beginning inventory + purchases − ending inventoryEnter beginning inventory in dollars, purchases during the period in dollars and ending inventory in dollars.

Work out the cost of what you actually sold before you calculate gross profit.

Worked example

Cost of goods sold$405,000
Goods available for sale$500,000

Example inputs

Beginning inventory$80,000
Purchases during the period$420,000
Ending inventory$95,000

How to interpret the result

Cost of goods sold is the cost of what you actually sold, not of what you bought. Start with the inventory you had, add what you purchased, and subtract what is still on the shelf. With $80,000 to begin, $420,000 in purchases and $95,000 left, the goods sold cost $405,000. The middle figure, $500,000, is the total that was available to sell.

At the worked-example inputs the cost of goods sold is $405,000. It rises with purchases during the period and beginning inventory and falls as ending inventory increases.

Interpretation boundary

These are planning metrics, not audited accounting or a valuation opinion.

Before you rely on it

What to check

Count the ending inventory at the same valuation method as the beginning. Switching between methods mid-year shifts COGS without any real change in cost.

The common error

Where people go wrong with cost of goods sold (COGS) calculator

Using purchases alone as the cost of sales. Anything still unsold at year end is an asset, and counting it as a cost understates profit.

Sensitivity evidence

How beginning inventory changes the cost of goods sold

Holding every other input at the worked-example value, moving beginning inventory from $64,000 to $96,000 moves the cost of goods sold from $389,000 to $421,000: a spread of $32,000, or 8% of the worked-example result.

Cost of Goods Sold (COGS) Calculator: cost of goods sold and goods available for sale across a range of beginning inventory, every other input held at the worked-example value.
Beginning inventoryCost of goods soldGoods available for sale
$64,000$389,000$484,000
$72,000$397,000$492,000
$80,000worked example$405,000$500,000
$88,000$413,000$508,000
$96,000$421,000$516,000

Every input, tested

Which input moves the cost of goods sold most

Of the 3 inputs, purchases during the period moves the cost of goods sold most ($84,000 across the range tested) and beginning inventory moves it least ($16,000).

Cost of Goods Sold (COGS) Calculator: cost of goods sold with each input moved on its own, every other input held at the worked-example value.
InputTested fromToCost of goods sold at each endSwing
Purchases during the period$378,000$462,000$363,000 to $447,000$84,000 (21%)
Ending inventory$85,500$104,500$414,500 to $395,500$19,000 (4.7%)
Beginning inventory$72,000$88,000$397,000 to $413,000$16,000 (4.0%)

Two variables at once

Cost of goods sold by beginning inventory and purchases during the period

Across the grid the cost of goods sold runs from $305,000 to $505,000. Moving beginning inventory from $64,000 to $96,000 shifts it by $32,000 at the middle column, and moving purchases during the period from $336,000 to $504,000 shifts it by $168,000 at the middle row, so purchases during the period is the bigger lever here.

Cost of Goods Sold (COGS) Calculator: cost of goods sold at each combination of beginning inventory (rows) and purchases during the period (columns).
Beginning inventory \ Purchases during the period$336,000$420,000$504,000
$64,000$305,000$389,000$473,000
$72,000$313,000$397,000$481,000
$80,000$321,000$405,000$489,000
$88,000$329,000$413,000$497,000
$96,000$337,000$421,000$505,000

The highlighted cell is the worked example: $405,000.

Step by step

The worked example, input by input

Worked-example inputs and the results they produce for the cost of goods sold (COGS) calculator.
InputValue usedWhat it means
Beginning inventory$80,000Enter the beginning inventory used in this calculation.
Purchases during the period$420,000Enter the purchases during the period used in this calculation.
Ending inventory$95,000Enter the ending inventory used in this calculation.
Cost of goods sold$405,000
Goods available for sale$500,000

Inputs, definitions and assumptions

Beginning inventory

Enter the beginning inventory used in this calculation. The prefilled worked-example value is $80,000.

Purchases during the period

Enter the purchases during the period used in this calculation. The prefilled worked-example value is $420,000.

Ending inventory

Enter the ending inventory used in this calculation. The prefilled worked-example value is $95,000.

How to use this calculator

  1. 1Verify the inputs. Gather beginning inventory, purchases during the period and ending inventory from your own documents; the prefilled values are examples.
  2. 2Save a baseline. The worked example puts the cost of goods sold at $405,000. Store your own version of it as Scenario A.
  3. 3Test one change. Start with purchases during the period, the input with the biggest effect here: moving purchases during the period from $378,000 to $462,000 takes the cost of goods sold from $363,000 to $447,000, a swing of 21% of the worked-example figure.
  4. 4Check the extremes. At half the example purchases during the period ($210,000) the cost of goods sold is $195,000; at double ($840,000) it is $825,000.

People also ask

Frequently asked questions

How do you calculate cost of goods sold (COGS)?

COGS = beginning inventory + purchases − ending inventory. Enter beginning inventory in dollars, purchases during the period in dollars and ending inventory in dollars. At the worked-example inputs the cost of goods sold is $405,000.

What does the cost of goods sold (COGS) result mean?

Work out the cost of what you actually sold before you calculate gross profit. At the worked-example inputs the cost of goods sold is $405,000. It rises with purchases during the period and beginning inventory and falls as ending inventory increases.

How much does beginning inventory change the cost of goods sold?

Holding every other input at the worked-example value, moving beginning inventory from $64,000 to $96,000 moves the cost of goods sold from $389,000 to $421,000, a spread of $32,000.

What are the limits of this cost of goods sold (COGS) calculator?

These are planning metrics, not audited accounting or a valuation opinion. The tables on this page test beginning inventory only from $64,000 to $96,000; a value outside that range is not tabulated here.

Which input moves the cost of goods sold most in the cost of goods sold (COGS) calculator?

Ranked by how far each moves the cost of goods sold across the range tested: purchases during the period ($84,000, 21%), ending inventory ($19,000, 4.7%) and beginning inventory ($16,000, 4.0%).

If I double purchases during the period in the cost of goods sold (COGS) calculator, does the cost of goods sold double?

Doubling it from $420,000 to $840,000 takes the cost of goods sold from $405,000 to $825,000, which is 2.04 times the worked-example figure. So the result scales almost exactly in proportion. Halving it to $210,000 gives $195,000.

How much does purchases during the period matter in the cost of goods sold (COGS) calculator?

The worked example uses $420,000. With the other inputs left at the worked example, moving purchases during the period from $378,000 to $462,000 takes the cost of goods sold from $363,000 to $447,000, a swing of 21% of the worked-example figure.

How much does ending inventory matter in the cost of goods sold (COGS) calculator?

The worked example uses $95,000. Holding every other input at its worked-example value, moving ending inventory from $85,500 to $104,500 takes the cost of goods sold from $414,500 to $395,500, a swing of 4.7% of the worked-example figure.

Which inputs change the goods available for sale in the cost of goods sold (COGS) calculator?

At the worked-example inputs it is $500,000. Beginning inventory takes it from $492,000 to $508,000 and purchases during the period takes it from $458,000 to $542,000.

How does depreciation affect profit?

It spreads an asset's cost over its useful life as an expense, so reported profit is lower than cash profit in the years it is charged. The cash left the business when the asset was bought.

All business finance questions answered

Sources and evidence

Free Calculators Online is independent and is not affiliated with or endorsed by the source organizations. Educational estimates only.

Background reading

Guides that use this calculator

Definitions

Terms used on this page

Gross margin : glossary term
Revenue minus cost of goods sold, divided by revenue.
Break-even point : glossary term
The volume at which total revenue equals total costs. It moves whenever the cost structure changes. Treat it as a range, not a point: fixed costs are only fixed within a capacity band.
Cash conversion cycle : glossary term
Inventory days plus receivable days minus payable days.
Contribution margin : glossary term
Revenue remaining after variable costs, available to cover fixed costs and profit.