COGS calculator
Work out what each unit really cost you once freight and duty are in (landed cost), your cost of goods sold (COGS) for a month, and what your costing method does to your margin. Every step is shown, so you can check the math.
COGS calculator: Landed cost per unit
Enter a shipment, or load the example, to see each product's landed cost per unit.
Your numbers stay in your browser. We don't store them. A copied link holds the numbers, never product names.
What a unit really cost you
Landed cost is the supplier price plus each unit's share of inbound freight, import duty and customs fees. Shopify keeps one Cost per item for each variant and saves it on every order. If that number is the bare supplier price, every profit report leaves out the cost of getting the stock to you. Say a shipment of candles and diffusers carries $264 of freight and duty on $2,200 of products: each unit costs about 12% more than the invoice says. Our step-by-step COGS guide works through that shipment.
Beginning + purchases − ending
This is the formula your accountant uses, with every amount valued at cost. Shopify's Gross profit by product report gives a second figure, built order by order. The two rarely match exactly. A small gap you can name, like two broken candles, is fine. A gap you can't explain needs finding before the number goes into your books. The same guide lists the usual causes.
Same stock, different profit
When you buy the same product at different prices, you need a rule for which price each sale used. FIFO (first in, first out) uses your oldest price first. LIFO (last in, first out) uses your newest. Weighted average blends them. The cash you spent doesn't change. What changes is how much of it counts as COGS this month and how much stays on the shelf as inventory. Our FIFO vs LIFO guide runs one product through all three.
The worked guides
The landed cost and period COGS tabs follow this post's worked month, step by step.
FIFO vs LIFO vs Weighted Average Cost on ShopifyThe FIFO vs LIFO tab uses this post's three lots and three months of sales.
Stocky Is Gone: How to Keep Average Cost on ShopifyWhat Stocky did for landed cost and average cost, and how to keep both without it.
Understanding COGSThe background: what COGS is and why it decides your real margin.
Let the app do this math
We're building CostSync, a Shopify app that keeps your cost history for every SKU and works out COGS and margin for you, so this doesn't live in a spreadsheet.
Common questions
- What is COGS?
- Cost of goods sold (COGS) is what the stock you sold cost you: the supplier price plus the costs of getting it onto your shelf, such as inbound freight and import duty. It doesn't include running costs like ads, apps or rent.
- Should I put freight and duty into Cost per item on Shopify?
- If you want Shopify's profit reports to match your books, yes. Enter the landed cost: the supplier price plus each unit's share of inbound freight, duty and customs fees. Use the landed cost tab to work it out.
- Why doesn't my COGS match Shopify's profit report?
- Shopify's report adds up the cost saved on each order. The period formula also catches stock that left without a sale, sales with no cost recorded, orders not yet shipped, and costs that changed mid-month. The period COGS tab shows the gap and the usual causes.
- Which costing method should I use?
- It depends on your store and your accountant. FIFO costs sales at your oldest prices first, LIFO at your newest, and weighted average at the average of everything on the shelf. The FIFO vs LIFO tab shows how much each one changes your reported profit. Ask your accountant which you can use for tax.
- Do you store the numbers I enter?
- No. The calculator runs in your browser and we don't store anything you type. If you copy a link, the numbers go into the link itself, without product names.
This calculator explains the math. It isn't tax or accounting advice. For how to report COGS, talk to your accountant. Questions or a figure that looks wrong? Tell us.