Cost of goods sold measures the direct cost associated with products that were sold during a period. A common inventory-based calculation starts with beginning inventory, adds purchases, and subtracts ending inventory.

Basic COGS formula

Beginning inventory + purchases − ending inventory = COGS. For example, if beginning inventory is 20,000, purchases are 55,000 and ending inventory is 18,000, COGS is 57,000.

Why ending inventory is subtracted

Goods still in stock at the end of the period have not yet been recognized as sold under this simplified relationship. Subtracting ending inventory removes those remaining goods from the cost assigned to sales.

What may need extra treatment?

Real accounting can be more detailed. Freight-in, production labor, manufacturing overhead, returns, inventory write-downs and the inventory costing method can affect reported COGS. The simple formula is useful for planning and checking arithmetic, but financial statements should follow the accounting rules applicable to the business.

Common errors

  • Using sales revenue instead of inventory purchases.
  • Mixing beginning and ending values from different periods.
  • Ignoring adjustments required by the accounting method.
  • Rounding intermediate values unnecessarily.

Calculate COGS online

Enter beginning inventory, purchases and ending inventory in the COGS Calculator to check the arithmetic instantly.