Cost of Goods Sold (COGS) Calculator

Enter opening inventory, purchases and closing inventory to get COGS.

How it is calculated

The tool uses the periodic-inventory formula COGS = O + P - C, where O is the value of inventory at the start of the period, P is what you purchased during it and C is the inventory still on hand at the end. All three are money amounts for the same period and the same valuation method (cost, not selling price), and none may be negative. The result is shown in dollars with two decimals. Closing inventory cannot be larger than opening inventory plus purchases, because you cannot end with more stock than was available; if it is, the tool shows no result so the count can be rechecked. Freight, labour or manufacturing overhead are not added unless you include them in the purchases figure.

Worked example

A shop starts the quarter with $45,000 of stock, buys $120,000 more and counts $38,000 at the end. Step 1: goods available for sale are 45000 + 120000 = 165000. Step 2: subtract what is left, 165000 - 38000. The tool shows $127,000.00, the cost of the products sold in the period. If the shop's sales were $190,000, gross profit would be 190000 - 127000 = $63,000 before other expenses.

Try this example →

Common mistakes

  • Valuing the closing stock at selling price instead of cost; this understates COGS and inflates profit.
  • Including purchases not yet received, or leaving out returns to suppliers; the purchases figure should reflect what really entered inventory.
  • Mixing balances from different periods, such as a year-end stock count with one month of purchases.
  • Forgetting that stolen or spoiled stock is missing from the closing count, so it ends up inside COGS rather than being shown separately.
  • Entering a closing count above opening plus purchases. The tool then shows no result; recount instead of adjusting the other figures to make it work.

Sources

About this calculator

Cost of goods sold follows the basic inventory equation: COGS = opening inventory + purchases − closing inventory — whatever inventory you started with, plus what you bought, minus what's left unsold, must be what you sold during the period.

It's the first line subtracted from revenue to get gross profit on every income statement, and retailers and manufacturers track it closely because it directly drives gross margin — a rising COGS relative to revenue, even with sales growing, usually signals supplier price increases, discounting, or inventory shrinkage eating into profitability.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators