How to Calculate COGS (Cost of Goods Sold)

Cost of Goods Sold (COGS) is what it cost to produce the goods a business actually sold during a period. This guide walks through the COGS formula, how it connects to Cost of Goods Manufactured (COGM), and a full worked example with real numbers.

By Amara TaylorFree guide

Quick answer: Cost of Goods Sold (COGS) is Beginning Finished Goods Inventory + Cost of Goods Manufactured (COGM) − Ending Finished Goods Inventory. It measures the cost of products actually sold during the period, not just produced, and is subtracted from revenue to calculate gross profit.

What is COGS?

COGS is the direct cost of the finished goods a company sold during a period: the materials, labor and manufacturing overhead embedded in those specific units. It appears directly on the income statement, right below revenue, where it is subtracted to calculate gross profit.

COGS is easy to confuse with Cost of Goods Manufactured (COGM), but they answer different questions. COGM is what a company finished producing during the period. COGS is what it actually sold. A manufacturer can finish more units than it sells in a given period, in which case COGM is higher than COGS and Finished Goods Inventory grows; or it can sell out of older stock, in which case COGS can be higher than COGM for that period.

The COGS formula

COGS = Beginning Finished Goods Inventory + Cost of Goods Manufactured (COGM) − Ending Finished Goods Inventory

This mirrors the logic of the COGM formula one level down the supply chain. Beginning Finished Goods Inventory is added because those already-finished units may be sold this period. Ending Finished Goods Inventory is subtracted because those units are still sitting unsold in the warehouse at period end.

How to calculate COGS: from Beginning Finished Goods through COGM to Ending Finished Goods Beginning Finished Goods Inventory of 60,000 dollars plus Cost of Goods Manufactured of 305,000 dollars minus Ending Finished Goods Inventory of 50,000 dollars equals Cost of Goods Sold of 315,000 dollars. From Finished Goods to COGS Beginning Finished Goods $60,000 + COGM $305,000 − Ending Finished Goods $50,000 = COGS $315,000 COGM itself comes from Beginning WIP + Total Manufacturing Cost − Ending WIP See the COGM Calculator for that step

How to calculate COGS, step by step

  1. Find your Cost of Goods Manufactured (COGM) for the period, using Beginning WIP + Total Manufacturing Cost − Ending WIP. Use the COGM Calculator if you have not worked this out yet.
  2. Find Beginning Finished Goods Inventory — the value of finished, unsold products on hand at the start of the period.
  3. Find Ending Finished Goods Inventory — the value of finished, unsold products on hand at the end of the period.
  4. Apply the formula: COGS = Beginning Finished Goods + COGM − Ending Finished Goods.

Worked example: continuing the furniture manufacturer

Take the furniture manufacturer from our COGM guide, which finished $305,000 worth of furniture during the quarter.

At the start of the quarter, the company had $60,000 of finished furniture sitting unsold in its warehouse. By the end of the quarter, that had fallen to $50,000 of unsold finished furniture.

COGS: $60,000 + $305,000 − $50,000 = $315,000.

The company’s income statement for the quarter would subtract this $315,000 in COGS from its revenue to arrive at gross profit. If the company sold this furniture for $450,000 in revenue, gross profit would be $450,000 − $315,000 = $135,000. Our gross margin guide walks through that calculation in full.

COGS vs. COGM vs. Total Manufacturing Cost

MetricWhat it measuresFormula
Total Manufacturing Cost (TMC)What production cost this period, ignoring WIPDirect Materials + Direct Labor + Overhead
Cost of Goods Manufactured (COGM)What was actually finished this periodBeginning WIP + TMC − Ending WIP
Cost of Goods Sold (COGS)What was actually sold this periodBeginning Finished Goods + COGM − Ending Finished Goods

Common COGS mistakes

  • Confusing COGS with COGM. COGM is what was finished; COGS is what was sold. They are only equal in a period where production exactly matches sales.
  • Leaving out Finished Goods Inventory changes. Using COGM alone as COGS ignores units sold from existing stock, or units produced but not yet sold.
  • Mixing in selling and administrative costs. COGS only includes production costs embedded in the units sold. Marketing, sales commissions and office overhead are operating expenses, not COGS.
  • Using inconsistent inventory valuation methods. Switching between FIFO, LIFO or weighted-average costing between periods distorts COGS and makes period-to-period comparisons unreliable.

Why COGS matters: COGS is the starting point for gross profit and gross margin, two of the most closely watched measures of whether a business’s core production and pricing are working. A rising COGS relative to revenue, even with sales growing, is often the first warning sign of margin pressure.

Have your COGM figure ready? Work out COGS instantly.

Try the COGM Calculator

COGS FAQs

What is the formula for COGS?

COGS = Beginning Finished Goods Inventory + Cost of Goods Manufactured (COGM) − Ending Finished Goods Inventory. For a retailer or reseller without manufacturing, COGM is replaced with Purchases: COGS = Beginning Inventory + Purchases − Ending Inventory.

What is the difference between COGS and COGM?

COGM is the cost of goods a company finished producing during the period. COGS is the cost of goods it actually sold during the period. A company can produce more than it sells, building up Finished Goods Inventory, or sell more than it produced that period by drawing down existing inventory.

Is COGS the same as cost of sales?

Yes, “cost of sales” and “Cost of Goods Sold” are generally used interchangeably, both referring to the direct production cost of the goods a business sold during a period.

Does COGS include labor?

Yes, direct labor involved in producing the goods sold is part of COGS, through Cost of Goods Manufactured. Indirect labor, such as sales staff or administrative wages, is not part of COGS.

How is COGS used in gross profit and gross margin?

Gross profit is Revenue minus COGS. Gross margin expresses that as a percentage of revenue: Gross Margin = (Revenue − COGS) ÷ Revenue × 100. Both measures depend directly on an accurate COGS figure.

Do service businesses calculate COGS?

Service businesses without physical inventory often calculate a similar figure called Cost of Services or Cost of Revenue instead, covering the direct labor and materials involved in delivering the service, since there is no Finished Goods Inventory to track.

What inventory valuation methods affect COGS?

FIFO (first-in, first-out), LIFO (last-in, first-out) and weighted-average costing can each produce a different COGS figure from the same underlying inventory activity, particularly when unit costs change over time. Businesses should apply one method consistently.

Amara Taylor, who builds and maintains Anchor AI Tools
Written and checked by Amara Taylor

Content Lead, Anchor AI Tools, California, USA. Spotted an error? Email hello@anchoraitools.com and it will be checked and corrected. See our editorial standards.