How to Calculate COGS for Your Shopify Store (With Examples)
Cost of goods sold (COGS) is usually the biggest number standing between your revenue and your profit — and the one Shopify can't fill in for you. Get it right and every other profit metric falls into place. Get it wrong and you're flying blind. Here's how to calculate it properly.
What COGS actually means
COGS is the direct cost of the products you sold in a period — not what you bought, what you sold. It's the per-unit cost to acquire or make a product, counted only when that unit leaves the door as a sale.
What to include (landed cost)
The mistake most merchants make is counting only the supplier's invoice price. Real COGS — often called landed cost — includes everything it took to get a sellable unit into your inventory:
- Product / manufacturing cost — what your supplier charges per unit.
- Inbound shipping & freight — getting it from supplier to you.
- Import duties & customs — tariffs, brokerage fees.
- Per-unit packaging — boxes, inserts, labels that ship with the product.
- Inbound handling — inspection, repackaging, prep.
Note what's not in COGS: ad spend, payment fees, and outbound shipping to the customer are real costs, but they're not cost of goods — they're separate lines in your profit math. (ProfitPeek tracks those separately so your margins stay clean.)
The formulas
Per-unit landed COGS = product cost + inbound freight + duties + packaging + handling, divided by units in the shipment.
Period COGS = beginning inventory + purchases − ending inventory. Or, more simply for tracking profit: per-unit COGS × units sold.
A worked example
You import 500 units of a product:
| Cost | Amount |
|---|---|
| Supplier (500 × $6.00) | $3,000 |
| Freight | $650 |
| Duties (8%) | $240 |
| Packaging (500 × $0.40) | $200 |
| Total landed | $4,090 |
| Per-unit COGS | $8.18 |
If that product retails for $29, your gross profit per unit is $20.82 (a 72% gross margin) — before fees, shipping, refunds, and ads. Using just the $6.00 supplier price would have overstated your margin and hidden $2.18 of cost per unit.
How to track COGS per product without a spreadsheet
Calculating one product's COGS once is easy. Keeping accurate landed cost across a catalog of 30, 100, or 500 SKUs — as supplier prices and freight change — is where spreadsheets fall apart. ProfitPeek lets you set COGS per product (bulk paste or CSV) once and then applies it automatically to every order, so your net profit and margin stay accurate as you sell.
Already know your COGS? Drop it into the free calculator with your revenue and other costs to see your true net profit and margin instantly.
Open the free calculatorRelated: Shopify shows revenue, not profit · Shopify fees explained