What is the FIFO method?
FIFO means "first in, first out." It assumes the first units you bought are the first units you sell. Cost of goods sold (COGS) is what the products you sold cost you to make or buy.
So under FIFO, your COGS uses your oldest prices. The stock still on your shelf keeps your newest prices. COGS is one of the main lines on your P&L, as our true profit and P&L guide explains.
FIFO only matters when you hold stock bought at different prices. Pure print-on-demand sellers do not hold stock. A supplier is the company that prints and ships for you, and it bills you per order. In that case, each order's cost is simply what the supplier charged for that order.
FIFO starts to matter when you:
- Buy blank shirts or hoodies in bulk to print yourself.
- Order a pre-printed run of a best seller to ship faster.
- Keep stickers, mugs or packaging in stock and restock at new prices.
What is the FIFO cost of goods sold formula?
The cost of goods sold FIFO formula has two parts.
The period formula is: COGS = Beginning Inventory + Purchases − Ending Inventory.
The FIFO rule tells you how to price ending inventory. You price the units left over at your most recent purchase costs. Every older unit is treated as sold.
You can also count COGS from the top down. Take your oldest batch (a "layer") first. Use up its units, then move to the next layer, until you reach the number of units sold. Both ways give the same answer.
How do you calculate FIFO COGS? A worked example
Say you run a print-on-demand store that also keeps one best-selling hoodie in stock. You print it in batches with a local printer. Prices rose this spring.
Here is March for that hoodie (example numbers):
| Batch | Units | Cost per unit | Batch cost |
|---|---|---|---|
| Beginning stock (Mar 1) | 40 | $18.50 | $740 |
| Restock (Mar 5) | 100 | $19.20 | $1,920 |
| Restock (Mar 20) | 60 | $20.10 | $1,206 |
| Total available | 200 | $3,866 |
You sold 150 hoodies in March. Under FIFO, you use up the oldest layers first:
- 40 units × $18.50 = $740
- 100 units × $19.20 = $1,920
- 10 units × $20.10 = $201
- FIFO COGS = $740 + $1,920 + $201 = $2,861
Ending inventory is the 50 newest units: 50 × $20.10 = $1,005.
Now check it with the formula. $740 + ($1,920 + $1,206) − $1,005 = $2,861. It matches.
If those 150 hoodies sold at $49 each, sales were $7,350. Gross profit (sales minus COGS) is $7,350 − $2,861 = $4,489. That is a 61.1% gross margin ($4,489 ÷ $7,350). Our guide to the cost of goods sold ratio shows how to track that number month to month.
Should landed costs go into each FIFO layer?
Yes. Landed cost is the full cost to get a unit ready to sell. It includes the item, plus the shipping to get it to you, plus any duties.
Say the March 5 batch came with a $60 freight bill. Spread it over the batch: $60 ÷ 100 = $0.60 per unit. That layer's real cost is $19.20 + $0.60 = $19.80, not $19.20.
Keep these out of the layer:
- Ad spend. It goes in operating expenses (the costs of running the business).
- Your Shopify plan and apps.
- Shipping to the customer, unless your books always put it in COGS. Pick one way and stick to it.
Our guide to inventory management costs covers the costs of holding stock, such as storage.
How does FIFO compare with LIFO and weighted average?
The three methods split the same $3,866 in different ways. Only the order of the layers changes.
LIFO means "last in, first out." The newest units are treated as sold first.
- 60 units × $20.10 = $1,206
- 90 units × $19.20 = $1,728
- LIFO COGS = $2,934. Ending inventory = $932.
Weighted average uses one blended cost per unit.
- $3,866 ÷ 200 units = $19.33 per unit
- COGS = 150 × $19.33 = $2,899.50. Ending inventory = $966.50.
Specific identification tracks the real cost of each unit you sell. It suits one-of-a-kind items. It also fits pure print-on-demand, where every order has its own supplier bill.
| Method | COGS | Ending inventory | Gross profit at $7,350 sales |
|---|---|---|---|
| FIFO | $2,861 | $1,005 | $4,489 |
| Weighted average | $2,899.50 | $966.50 | $4,450.50 |
| LIFO | $2,934 | $932 | $4,416 |
The table above uses the example numbers from this article, not market data.
How does FIFO change your taxes when prices rise or fall?
When prices rise, FIFO gives you the lowest COGS. Lower COGS means higher profit on paper, and so more taxable income. In our example, FIFO shows $73 more profit than LIFO ($2,934 − $2,861).
When prices fall, it flips. FIFO then gives the highest COGS and the lowest profit.
FIFO also keeps your ending stock close to today's prices. That makes your balance sheet (the list of what the business owns and owes) more true to life.
Is FIFO allowed under GAAP, IFRS and IRS rules?
Yes. FIFO is allowed under US GAAP (the US accounting rules), under IFRS (the rules most other countries use) and by the IRS. LIFO is allowed in the US but not under IFRS. In the US, you must file IRS Form 970 to start using LIFO.
To change from one inventory method to another, the IRS says you must file Form 3115, according to IRS Publication 538.
Does a small Shopify store even need formal FIFO?
Often not for taxes. The IRS lets a "small business taxpayer" skip keeping a formal inventory. According to IRS Publication 538, that means average yearly gross receipts of $26 million or less (indexed for inflation) over the 3 prior tax years. Most print-on-demand stores are far below that.
There is a catch. The IRS says you still need an inventory method that "clearly reflects income." If you choose to keep an inventory, you generally must use the accrual method. Accrual means you record a sale when it happens, not when the cash arrives. IRS Publication 334 points small businesses to these same rules.
Our guide to accrual vs. cash profit and loss statements explains which one fits your store.
This is general information, not tax advice. Rules change and vary by situation — consult a licensed CPA or tax professional before acting.
How do you run FIFO in practice on Shopify?
Shopify lets you enter a "cost per item" for each product variant. It does not keep FIFO layers for you. So when your cost changes, you need your own layer list.
Here is a simple setup that works for a small store:
- Make one spreadsheet tab per stocked product.
- Add a row for each batch: date, units, cost per unit with landed costs added in, units left.
- Each month, subtract units sold from the oldest row first.
- Add up the cost of the units you removed. That is your FIFO COGS.
- Put that number in your accounting tool, such as QuickBooks or Xero.
A spreadsheet is fine while you stock a few products. Once you hold many variants with frequent restocks, an inventory app or a bookkeeper saves time and errors.
How do returns and damaged items change FIFO COGS?
A returned unit you can sell again goes back into stock. Put it back at the cost it left with, and lower COGS by the same amount.
A damaged unit you cannot sell gets written off. Remove it from its layer and record the cost as a loss.
For print-on-demand orders, a misprint is different. You ask the supplier for a reprint or refund, so it never touches a FIFO layer.
Where does Victor fit?
PodVector AI is the print on demand AI. Victor is the AI employee who runs the work of a print-on-demand business, from designs and listings to orders, ads and the numbers.
For money questions like this one, Victor knows the real cost and profit of every order. That is sales minus supplier cost, fees, shipping, refunds and ad spend. He watches Printify, Printful and Gelato for cost changes, and he runs a monthly supplier cost review on his own. When a cost rises, Victor reprices the thin-margin products and writes a short report on what changed.
You can put Victor to work on your store.
FAQs
What is the cost of goods sold formula FIFO uses?
It is Beginning Inventory + Purchases − Ending Inventory. Under FIFO, ending inventory is priced at your newest costs. That leaves your oldest costs in COGS.
Does FIFO apply to print-on-demand orders?
Mostly no. The supplier prints each order and bills you for that order, so the cost is already exact. FIFO matters only for stock you buy in batches, like blanks or a pre-printed run.
Is FIFO better than LIFO for a small store?
FIFO is simpler and matches how stock really moves. When prices rise, it shows more profit, so you may owe more tax. Your CPA can tell you which fits your situation.
What if I bought stock at different prices on the same day?
Treat each purchase as its own layer. You can also combine them into one layer at the blended cost. Pick one approach and use it every time.
Where do I learn more about FIFO and my P&L?
Start with our true profit and P&L guide. Then read our deeper look at FIFO cost of goods sold for more examples.