Weighted Average, Last Cost or FIFO: Which Cost Belongs in Shopify's One Field?
Ask "what does this SKU cost?" while you're holding stock bought at two different prices, and there is no single true answer — there are three defensible ones. Weighted average, last cost and FIFO are three methods for collapsing a purchase history into one number, and in a rising-cost year they can disagree by ten margin points on the same SKU. Shopify gives you exactly one cost per item field to hold the result. Which number you put there is a real decision, and most stores make it by accident.
Why there are three answers at all
The moment your on-hand stock spans more than one purchase price, "cost" splits into two different questions:
- Backward-looking: what did the units I just sold cost me? This is the accounting question — it decides your reported profit.
- Forward-looking: what will it cost me to replace the unit I just sold? This is the pricing question — it decides whether your retail still makes sense.
The three methods are just three positions between those poles. FIFO and weighted average answer the backward question with different smoothing; last cost ignores history entirely and answers the forward one.
One SKU, six months, three numbers
A concrete timeline makes the divergence visible. One SKU, retail held at $14.99 throughout:
- January: receive 100 units at $8.00. Sell 80 over the quarter; 20 remain.
- April: receive 100 units at $9.20 (+15%). On hand: 120. Sell 90 through June; 30 remain.
- July: receive 100 units at $10.10 (+9.8%). On hand: 130.
After the July receipt, each method reports a different cost for the same shelf of goods:
The weighted average is worth tracing once, because it's a running blend, not a simple average of the price list. After the April receipt: (20 × 8.00 + 100 × 9.20) / 120 = $9.00. After selling 90 and receiving July's batch: (30 × 9.00 + 100 × 10.10) / 130 = $9.85. Notice the average always lags the market — supplier cost has risen 26% since January, the blend has moved 23%, and it will keep trailing as long as costs keep climbing.
FIFO, for the same period, doesn't produce one cost at all — it produces layers. The 90 units sold in spring cost $804.00 under FIFO (20 at $8.00, then 70 at $9.20), $810.00 under weighted average (90 × $9.00). The gap here is small; stretch the timeline or the price moves and it isn't.
What each method is actually for
| Method | Question it answers | Data it needs | When costs rise |
|---|---|---|---|
| FIFO | Accounting COGS, per layer consumed | Every receipt as a dated lot, depletion order | Reports the lowest COGS — oldest, cheapest units sell first on paper |
| Weighted average | Accounting COGS, smoothed | Running quantity and value per SKU, updated on every receipt | Lags the market; margin looks better than replacement reality |
| Last cost | Replacement cost — "what does the next unit cost me?" | Just the newest price file | Tracks the market immediately; hardest on your reported margin |
FIFO is the bookkeeper's method: precise, defensible, and the most expensive to operate. It requires lot tracking — every receipt stored as a dated layer, every sale depleting layers in order. Accounting software does this for you; a spreadsheet does it until the first stock adjustment, return or miscount, after which the layers are fiction. There is no way to express layers in a single cost field, so for a Shopify store without inventory accounting software, FIFO is effectively off the table as an operational number — and that's fine, because nothing about running the store requires it.
Weighted average is the honest middle for reporting. It needs only two running numbers per SKU and survives messy reality better than FIFO layers do. Its weakness is exactly its smoothing: in a rising market the average is always yesterday's news, and any price set from it is set against a cost you can no longer buy at.
Last cost is the operator's method. It's the only one of the three that tells you whether your current retail survives contact with your supplier's current price list — which is the decision you actually face every time a new file lands.
What belongs in Shopify's field: replacement cost
For a store that buys wholesale and resells, the strongest choice for the single field is the latest supplier cost — landed, if you import. Three reasons.
First, the field's main job is forward-looking. The cost per item drives the margin you see when repricing, and it's the number any tool reads when checking your catalog against a price list. Feed it the weighted average and you will systematically underprice in a rising market. On our SKU, repricing to a 40% target from the average gives 9.85 / 0.60 = $16.42 — but every unit you order from now on costs $10.10, and at $16.42 that's a (16.42 − 10.10) / 16.42 = 38.5% margin. You missed your target before the ink dried. Priced from last cost: 10.10 / 0.60 = $16.83, and the target holds on every future unit.
Second, the error direction is the safe one. As we covered in the profit reports teardown, every distortion in Shopify's profit math — missing costs, stale costs, omitted fees — flatters you. Last cost is the one choice that errs the other way: units bought cheaper than today's price report a slightly worse margin than accounting-true. A report that understates profit never ambushes you; in a falling market the same logic makes it honest about the cheaper replenishment to come.
Third, it's the only method the field can actually hold. One number, no history, no layers — that's the field's structure. Last cost is the only method that is one number by nature. The other two are summaries of a history Shopify doesn't store, which means maintaining them in the field is manual work that decays the moment you skip an update.
Whichever you choose, the update is the method
A costing method isn't a preference you pick once — it's an update you perform every time a price changes. The weighted average is wrong unless recomputed on every receipt; last cost is wrong unless the field moves the week the price file does. The store that chose "last cost" but updates twice a year is actually running a fourth method: random historical cost, the January $8.00 still sitting in the field in July, reporting a 46.6% margin on a SKU really earning 32.6% at replacement. That failure mode — not the choice of method — is where most catalogs actually lose the thread.
The mechanics of keeping the field current are a solved problem: diff each incoming price file against the catalog (matching supplier spreadsheets to your SKUs is the hard half), then push the changed costs in bulk — carefully, because a bulk cost update can also wipe the field if the file has empty cells. And if you import, remember the number worth tracking is landed cost, not the invoice line — the gap runs 10–30% for typical importers.
See what replacement cost does to your margins
Drop your latest supplier price list and your Shopify export into the free Supplier Price Margin Checker. It matches by SKU and recomputes every margin at the new cost — the replacement-cost view of your whole catalog, in one pass.
Open the free checker ↗