How to Calculate Cost of Goods Sold
Cost of goods sold is the direct cost of the items you actually sold in a period. It is the line that sits directly under revenue, and gross profit is what remains after it. Get it wrong and every margin figure downstream is wrong too.
The formula
COGS = Opening inventory + Purchases during the period − Closing inventory
The logic: everything you started with plus everything you bought, less whatever is still on the shelf, is what left the building.
Worked example
A shop starts the quarter with $2,400 of stock, buys $6,100 more, and counts $1,900 remaining at the end.
COGS = $2,400 + $6,100 − $1,900 = $6,600
If revenue for that quarter was $14,000, gross profit is $7,400 and gross margin is 52.9%.
What belongs in COGS
- Purchase cost of goods sold
- Raw materials and components that go into a made product
- Inbound freight and import duty on those goods
- Direct production labour, where you pay someone to make the item
- Packaging that is part of the product itself
What does not
- Marketing and advertising
- Platform subscription fees and software
- Outbound shipping to the customer (normally a selling expense)
- Your own admin time
- Unsold inventory — it stays in inventory until it sells
That last point is the one that trips people up. Buying $5,000 of stock in a month does not create $5,000 of COGS in that month. Only the portion that sold does. This is why a month with a big stock order can look catastrophic on a naive spreadsheet and be perfectly healthy in reality.
Why it matters for pricing
Gross margin from COGS tells you whether the product line works at all. Net margin — after fees, postage, advertising and overheads — tells you whether the business works. You need both, and they answer different questions. A shop with a strong 55% gross margin can still lose money if fees and postage take 30 points of it.
Keep the count honest
The formula depends entirely on your closing inventory figure being real. Count it, do not estimate it, and write off what is genuinely unsellable rather than carrying it forever. An inflated closing inventory understates COGS and overstates profit — a flattering error that eventually corrects itself painfully.
Do the calculation
Profit Margin Calculator
Net profit, net margin and markup with every fee subtracted.
How to Calculate Profit Margin
The profit margin formula, the difference between gross and net margin, and the three mist…
Etsy Fees Explained
Every fee Etsy charges sellers — listing, 6.5% transaction, payment processing and Offsite…