📈
📈 Business tools

Cost of Goods Sold (COGS) Calculator (inventory method)

Results update as you type. Any currency.

Your numbers

Understanding the cost of goods sold (COGS) calculator — concept and principle

This calculator finds the cost of goods sold with the periodic inventory method: what you had at the start, plus what you bought or made, minus what is left at the end. With net sales entered it also shows gross profit, gross margin, inventory turnover and days of inventory. Retailers, small manufacturers and bookkeepers use it at year end or when preparing an income statement.

What left the shelvesWhat left the shelves: $40,000 + $185,000 + $6,000 (start + purchases + freight-in); − $52,000 (still on the shelf at the end) → $179,000 (COGS · gross margin 42.3%)What left the shelves$40,000 + $185,000 + $6,000start + purchases + freight-in− $52,000still on the shelf at the end$179,000COGS · gross margin 42.3%
What left the shelves — with the default inputs: $179,000.

How it is calculated

The principle

Every product cost ends up in one of two places: still on the shelf (ending inventory) or sold (COGS). Starting from everything you could have sold and subtracting what remains leaves what must have been sold. This is why the ending count matters so much: overstating it understates COGS and overstates profit. Both inventory counts must use the same valuation method, such as FIFO or average cost.

Worked example

Defaults: beginning inventory 40,000; net purchases 185,000; direct labour 0; freight-in 6,000; ending inventory 52,000; net sales 310,000.

  1. Goods available = 40,000 + 185,000 + 0 + 6,000 = $231,000.
  2. COGS = 231,000 − 52,000 = $179,000.
  3. Gross profit = 310,000 − 179,000 = $131,000; margin = 42.3%; COGS = 57.7% of sales.
  4. Average inventory = 46,000; turnover = 179,000 ÷ 46,000 = 3.89 times.
  5. Days of inventory = 365 × 46,000 ÷ 179,000 = 93.8, shown as 94.
How Cost of goods sold (COGS) changes with Net purchases (after returns and discounts)How Cost of goods sold changes with Net…0100,000200,000300,000400,00046,25092,500138,750185,000231,250277,500370,000Example: $179,000Net purchases (after returns and discounts)
Each point is the calculator re-run with only “Net purchases (after returns and discounts)” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Net purchases (after returns and discounts)Cost of goods sold (COGS)
46,250$40,250
92,500$86,500
138,750$132,750
185,000$179,000
231,250$225,250
277,500$271,500
370,000$364,000

How to read the result

A higher gross margin means more of each sale is left to pay operating costs. Turnover shows how quickly stock sells: about 3.9 times a year here, or roughly 94 days on the shelf. Faster turnover ties up less cash but risks stock-outs. Compare with your own past years and similar businesses, since grocery and fashion, for example, turn stock at very different speeds.

Common mistakes

Keep in mind: The result is only as good as your inventory count. Tax rules on inventory valuation differ by country; this is not accounting or tax advice.

Frequently asked questions

Is COGS an expense?

Yes. It is the expense for the products sold in the period and appears directly below revenue on the income statement.

Does COGS include shipping to customers?

Usually not. Freight-in to bring goods to you is a product cost; shipping to customers is generally a selling expense.

What happens if ending inventory is overstated?

COGS is understated and gross profit is overstated by the same amount.

Sources: OpenStax, Principles of Accounting, Volume 1: Financial Accounting, chapter 10 "Inventory"

Checked 9 Nov 2026. U.S. Internal Revenue Service, Fact Sheet FS-2006-23 “Cost of Goods Sold and the Tax Gap” (beginning inventory + net purchases + labor + materials and supplies + other costs − ending inventory). Gross margin ratio: OpenStax, “Principles of Accounting, Volume 1: Financial Accounting”, section 6.6.

📈 All business tools →🌍 Calculators by country →