Worked examples
Quarterly COGS for a growing store
| Beginning inventory | $40,000.00 |
| Purchases during period | $210,000.00 |
| Ending inventory | $50,000.00 |
| Cost of goods sold (COGS) | $200,000.00 |
| Average inventory | $45,000.00 |
$200,000 of cost of sales to set against the quarter’s revenue for gross profit.
Destocking quarter
| Beginning inventory | $60,000.00 |
| Purchases during period | $90,000.00 |
| Ending inventory | $30,000.00 |
| Cost of goods sold (COGS) | $120,000.00 |
| Average inventory | $45,000.00 |
COGS of $120,000 outruns the $90,000 purchased: $30,000 came off the existing shelf.
Frequently asked questions
What costs are included in COGS?
Everything it took to get the sold goods ready to sell: the product cost itself, freight-in and import duties, and direct labor such as assembly or kitting. Not included: marketing, outbound shipping to customers, payment fees, rent, and payroll — those are operating or selling expenses. The freight distinction trips people up most: freight-in (supplier to you) belongs in COGS; freight-out (you to the customer) does not.
Is cost of sales the same as cost of goods sold?
For a merchant selling physical products, yes — cost of sales and cost of goods sold name the same line, and this calculator computes either. The terms diverge only outside retail: service businesses say cost of sales or cost of revenue because there are no goods, and some include delivery or direct service labor there. On your P&L, whichever label your accounting software uses, the formula behind it is the one on this page.
How is COGS different from operating expenses?
COGS scales with what you sell; operating expenses run whether you sell or not. Product cost and inbound freight rise and fall with units sold, while rent, salaries, software, and marketing bill you regardless. The split matters because each drives a different decision: COGS problems are fixed with sourcing and pricing, operating-expense problems with overhead cuts — and blending them hides which lever needs pulling.
What is the difference between the periodic and perpetual method?
This calculator uses the periodic method: count inventory at the start and end, add purchases, and back into COGS for the whole period. Perpetual systems record the cost of each sale as it happens, so COGS is always current without a count. Most e-commerce platforms and inventory apps run perpetual under the hood; the periodic formula remains the cross-check, because it catches what perpetual records miss — shrinkage, unrecorded damage, and receiving errors.
Why does an inaccurate ending inventory break the number?
Because ending inventory is subtracted in full, every dollar of count error lands directly in COGS and flows straight through to gross profit. Overstate the ending count by $5,000 and profit looks $5,000 better than it is; the error then reverses next period, whipsawing both statements. It is the quiet reason physical counts and cycle counting are worth the effort even when a system tracks stock continuously.
Related calculators
- Gross Profit Calculator
- Profit Margin Calculator
- Inventory Turnover Calculator
- Retail Inventory Method Calculator
- Break-even ROAS Calculator
- All calculators
Part of the Unit Economics collection.