Cost of Goods Sold Calculator

Work out COGS from opening stock, purchases and closing stock, with gross profit alongside.

LET’S WORK IT OUT

Your inputs

Results update as you type. Check the units before you begin.

View result ↓
YOUR RESULT
—
Cost of goods sold
Adjust the inputs

Your result updates live as you type.

Cost of goods sold is the cost of the stock you actually sold in a period, not the stock you bought. The two differ whenever inventory levels move, and the standard reconciliation handles it: opening inventory plus purchases gives the goods available for sale, and subtracting closing inventory leaves what must have gone out of the door.

This matters because purchases alone can badly misstate profitability. A business that builds stock ahead of a busy season will show heavy purchases and light COGS, while one running stock down shows the reverse. Using purchases as a proxy for COGS makes a strong quarter look weak and a weak one look strong.

Include everything that gets the goods ready to sell: the purchase price, inbound freight, import duty and direct production labour. Leave out selling costs, outbound delivery to customers and general administration, which belong in operating expenses. Where inventory is written off or stolen, that cost typically appears in COGS too, which is why an unexplained COGS increase is a standard signal to check for shrinkage.

The formula

COGS = opening inventory + purchases − closing inventory
opening inventory
Value of stock at the start of the period
purchases
Stock bought or produced during the period, including inbound freight
closing inventory
Value of stock at the end of the period
goods available
opening inventory + purchases

How to use this calculator

  1. Enter the opening inventory value from the start of the period.
  2. Enter purchases and production costs added during the period.
  3. Enter the closing inventory value, ideally from a physical count.
  4. Add revenue to see gross profit and the COGS ratio below the gauge.

Worked examples

A period where stock fell

Opening stock of $85,000 plus $320,000 of purchases gives $405,000 of goods available. Closing stock of $72,000 leaves COGS of $333,000 — $13,000 more than purchases alone, because $13,000 of stock was run down.

The gross profit that follows

Against revenue of $520,000, COGS of $333,000 gives gross profit of $187,000 and a margin of 36.0%. Had purchases been used instead of COGS, the margin would have read 38.5% — flattering by 2.5 points.

How to read your score

0–50,000SmallA modest cost base for the period.
50,000–200,000ModerateTypical of a small trading business.
200,000–500,000SubstantialA mid-sized operation or a strong quarter.
500,000–2,000,000LargeSignificant volume moving through inventory.
2,000,000–—Very largeEnterprise-scale cost of sales.

Frequently asked questions

Why not just use purchases as COGS?

Because purchases include stock you have not sold yet. The two only match when opening and closing inventory are identical, which almost never happens.

What costs belong in COGS?

Direct materials, direct labour, inbound freight, duty and manufacturing overhead. Selling costs, marketing, outbound shipping to customers and administration go below the gross line.

How does the inventory valuation method change COGS?

Substantially, when prices are moving. FIFO charges the oldest costs to COGS and leaves recent costs on the balance sheet; weighted average smooths both. In a period of rising prices FIFO reports lower COGS and higher profit.

Do write-offs go in COGS?

Usually yes, since damaged or stolen stock never becomes a sale but has left inventory. Large write-offs are often disclosed separately so the underlying cost ratio stays comparable.

COGS reference

The reconciliation, line by line
LineAmountRunning total
Opening inventory$85,000$85,000
Add purchases$320,000$405,000
Goods available for sale$405,000
Less closing inventory$-72,000$333,000
Cost of goods sold$333,000$333,000

Every figure follows from the two inventory counts and the purchase total.

COGS when closing inventory changes
Purchasesclosing $40000closing $60000closing $72000closing $90000closing $120000
$200000 purchased$245,000$225,000$213,000$195,000$165,000
$280000 purchased$325,000$305,000$293,000$275,000$245,000
$320000 purchased$365,000$345,000$333,000$315,000$285,000
$400000 purchased$445,000$425,000$413,000$395,000$365,000
$500000 purchased$545,000$525,000$513,000$495,000$465,000

Opening inventory held at $85,000 throughout.

Related calculators