Key takeaways
- An inventory costing method is the rule that assigns cost to the units you sold (COGS) versus the units still on hand (ending inventory).
- FIFO expenses your oldest costs first, LIFO expenses your newest costs first, and weighted average gives every unit a blended average cost.
- When costs are rising, FIFO shows the lowest COGS and highest profit, LIFO the highest COGS and lowest profit, and weighted average lands in between.
- LIFO is allowed under US GAAP but banned under IFRS, needs an IRS election, and isn’t supported by most ecommerce platforms, so few online sellers use it.
- Weighted average is the practical default for ecommerce: QuickBooks Online uses FIFO, Xero uses weighted average, and Shopify stores a single cost per item.
FIFO, LIFO, and weighted average are three ways to answer one question: when you sell a unit, which purchase cost do you expense? The goods on your shelf are identical, but the method you choose changes your COGS, your profit, and your tax bill. Here’s how each one works and which fits an ecommerce business.
What are inventory costing methods?
An inventory costing method is the rule you use to assign cost to the units you sold and the units you still hold. Because you buy the same product at different prices over time, the method decides which of those costs becomes cost of goods sold (COGS), the direct cost of the goods you sold, and which stays on the balance sheet as ending inventory.
The goods themselves don’t change. Two identical widgets sit side by side, one bought at $10 and one at $14, and the method is what tells you which cost to move when a customer buys one. That choice flows straight into your profit and your taxes, which is why it’s worth getting right before you calculate your cost of goods sold each month.
Three methods cover almost every ecommerce business, and a fourth, specific identification, handles unique or serialized items like art or numbered collectibles.
FIFO (first in, first out)
FIFO assumes the oldest costs leave first. When you sell a unit, you expense what you paid for your earliest stock, so COGS reflects your oldest purchase prices and ending inventory carries your most recent ones. It usually mirrors how goods physically move, which makes it a natural fit for dated or perishable products.
FIFO’s quirk shows up when prices climb. Because the cheapest, oldest costs hit COGS first, FIFO reports the lowest COGS, the highest profit, and the highest ending inventory value of the three methods. Higher profit reads well on paper, but it also means a higher tax bill in a rising-cost environment.
FIFO is the most common method for ecommerce brands selling food, supplements, or cosmetics, where old stock genuinely has to move before new stock, and it’s the method built into QuickBooks Online.
LIFO (last in, first out)
LIFO flips the assumption: the newest costs leave first. COGS reflects what you paid most recently, and ending inventory sits at your older, often lower costs. When prices rise, that pushes the highest costs into COGS, so LIFO reports the highest COGS and the lowest profit, which lowers taxable income.
That tax angle is the whole appeal, and it comes with strings. LIFO is permitted under US GAAP but prohibited under IFRS, the standards used across most of the world, so it’s unavailable for many non-US accounts. It also requires a formal election with the IRS, and most ecommerce platforms and accounting tools don’t support it out of the box.
For online sellers, LIFO is rare enough that you can treat it as the exception, not a real option.
Where LIFO does show up is large US retailers with steadily rising costs, who use it to defer tax and track the gap against FIFO as a LIFO reserve. For a growing ecommerce brand, that compliance overhead almost never pays for itself, and the IFRS ban closes the door if you ever raise money or sell to a buyer who reports on international standards.
Weighted average cost
Weighted average gives every unit the same blended cost. You take the total cost of the goods available and divide by the total units to get one average cost per unit:
Total cost of inventory ÷ total units available = average unit cost
That average then applies to both COGS and ending inventory. Buy 100 units at $10 and 100 at $14, and every unit now costs $12 on your books, whether it sells or stays. The method smooths out the swings between purchase batches, so a single expensive reorder doesn’t jerk your margins around.
It’s also the method most inventory and accounting software applies by default, which is a big part of why it’s the practical choice for ecommerce. One detail worth knowing: under a system that tracks inventory in real time, the average recalculates with each new purchase; under a period-end system, you compute it once for the whole period.
FIFO vs LIFO vs weighted average: a worked example
Put the same numbers through all three methods and the difference stops being abstract. Say you start the month with no stock, buy 100 units at $10, then buy another 100 at $14, giving you 200 units and $2,400 of goods available. You sell 120 units at $25 each, for $3,000 in revenue.
Under FIFO, the first 120 units sold come from the oldest costs: all 100 units at $10 plus 20 at $14, for a COGS of $1,280. Under LIFO, they come from the newest costs: 100 units at $14 plus 20 at $10, for a COGS of $1,600. Weighted average blends everything to $12 a unit, so 120 units sold cost $1,440.
Whatever COGS leaves, the rest stays in ending inventory, and the gap flows straight to gross profit, and to your gross margin once you read it as a share of revenue. Here’s the full picture:
The same purchases and sales under all three costing methods (rising costs, $10 to $14 per unit)
| Method | COGS | Ending inventory | Gross profit |
| FIFO | $1,280 | $1,120 | $1,720 |
| Weighted average | $1,440 | $960 | $1,560 |
| LIFO | $1,600 | $800 | $1,400 |
Same goods, three profits. With costs rising from $10 to $14 a unit, FIFO reports $1,720 of gross profit, weighted average $1,560, and LIFO $1,400, all on the exact same $3,000 of sales.
Which inventory costing method should you use?
For most ecommerce businesses, weighted average is the default worth reaching for. It’s simple, it smooths cost changes across reorders, and it’s almost certainly what your software already runs. FIFO is a strong fit when your goods are dated or perishable and you want cost to follow the physical flow of stock.
LIFO rarely makes sense online, given the IFRS ban, the IRS election, and thin platform support. Specific identification fits only unique or high-value serialized items.
Whatever you choose, your books and your platform should agree, and the accurate figure each method works from is your landed cost, the full per-unit cost to get a product on your shelf.
The method also sets your ending inventory value, which feeds ratios like inventory turnover, so a consistent method keeps those numbers comparable too. Here’s what the common tools default to:
Default inventory costing method by platform
| Platform | Costing method |
| QuickBooks Online | FIFO |
| Xero | Weighted average |
| Shopify | Single cost per item (no cost layers) |
Can you change your inventory costing method?
You can, but not on a whim. The IRS expects you to pick a method and apply it consistently, so switching generally means filing for a change in accounting method on Form 3115, and electing LIFO in the first place requires Form 970. Consistency isn’t red tape for its own sake; it’s what keeps one month’s profit comparable to the next.
Flip between methods and your margins jump for reasons that have nothing to do with the business, which muddies every trend and invites questions at tax time. It matters more the moment someone else reads your numbers: a lender or a buyer normalizes your margins on a consistent method, and a mid-year switch is exactly the kind of thing that stalls a deal.
Pick the method that fits, set your software to match, and record the cost the same way each period so your ecommerce accounting stays clean and, when a sale happens, you record the cost in your books consistently. This is general information, not financial or tax advice; confirm the right method and any change with your accountant.
Frequently asked questions
Which inventory costing method is best for ecommerce?
Weighted average is the best fit for most ecommerce businesses, because it smooths cost changes across reorders and is the method most accounting and inventory platforms already run. FIFO is a solid alternative when your products are dated or perishable and you want cost to follow how stock physically moves.
Is LIFO allowed under GAAP and IFRS?
LIFO is allowed under US GAAP but banned under IFRS, the accounting standards used across most of the world. In the US, it also requires a formal election with the IRS, which is one reason few ecommerce sellers use it.
What inventory method does QuickBooks use?
QuickBooks Online uses FIFO for inventory, expensing your oldest costs first. QuickBooks Desktop and Enterprise default to average cost, with FIFO available as an option, so confirm which product and setting you’re on before you rely on the number.
Does FIFO or LIFO give higher profit when prices rise?
FIFO gives higher profit when prices rise, because it expenses your cheapest, oldest costs first and leaves a lower COGS. LIFO does the opposite, pushing your newest and highest costs into COGS, which lowers reported profit and taxable income.
What’s the difference between FIFO and weighted average?
FIFO expenses your oldest purchase costs first, so COGS and ending inventory reflect specific batch prices, while weighted average blends every unit into one average cost. FIFO tracks cost layers over time; weighted average smooths them into a single number that’s easier to maintain.
Can I switch from FIFO to weighted average?
You can switch from FIFO to weighted average, but the IRS treats it as a change in accounting method that generally requires filing Form 3115 and applying the new method consistently going forward. Talk to your accountant before you change, since it affects both your books and your taxes.