Inventory Accounting Basics: COGS, FIFO and Average Cost
If you sell physical products, the way you account for inventory decides what your profit looks like, what you pay in tax and whether your balance sheet is telling the truth. This explainer covers cost of goods sold, the three main costing methods and how to choose one, with a single worked example carried through all three.
Key takeaways
- Buying stock is not an expense. Inventory sits on the balance sheet as an asset until it sells, then moves to cost of goods sold.
- When prices change, you need a rule for which cost goes with which sale. The main rules are FIFO, LIFO and weighted average cost.
- LIFO is allowed under US GAAP for tax and reporting but prohibited under IFRS, which most other countries use.
- Pick a method you can apply consistently. Switching methods is possible but involves paperwork and, in the US, IRS approval.
New product businesses often make the same mistake in their first year: they treat every purchase of stock as an expense the day they pay for it. Profit swings wildly from month to month depending on when deliveries arrive, the accountant unwinds it all at year end, and the owner never really knows whether the business is making money.
Inventory accounting fixes this by matching the cost of a product to the month it is sold, not the month it was bought. Once you understand that single idea, the rest is bookkeeping.
Inventory, COGS and the basic equation
When you buy stock, you exchange one asset (cash) for another (inventory). Nothing hits the profit and loss yet. When you sell an item, two things happen: revenue is recorded, and the cost of that item moves from inventory to an expense called cost of goods sold (COGS). Revenue minus COGS is gross profit.
For a period, the relationship is:
COGS = opening inventory + purchases − closing inventory
Suppose you start the quarter with $20,000 of stock, buy $50,000 more and count $18,000 on the shelves at the end. COGS for the quarter is $20,000 + $50,000 − $18,000, which is $52,000. If sales were $90,000, gross profit is $38,000 and gross margin is about 42%.
What goes into inventory cost
Inventory cost is more than the supplier's invoice. Under both US GAAP and IFRS it includes the costs of getting goods to their present location and condition: purchase price, import duties, freight in, and for manufacturers, direct labor and a share of production overhead. It excludes selling costs, storage after production is complete and general administration. Small businesses commonly leave freight out of unit costs, which quietly overstates gross margin.
Common mistake
Expensing inventory when it is purchased. This understates profit in months with big deliveries and overstates it in months without, makes margins impossible to track, and in the US is generally not permitted for tax once inventory is a material part of the business. Record stock as an asset and move it to COGS as it sells.
Why you need a costing method
If every unit cost the same, COGS would be simple. In practice, prices change between purchases. If you bought 100 units at $10 in January and 100 at $12 in February, then sold 50 in March, which cost do you charge: $10, $12 or something in between? Your costing method is the rule that answers that question. The three methods below use one running example.
The running example
Imagine a shop that buys the same product three times in a quarter: 100 units at $10, then 100 units at $12, then 100 units at $14, for 300 units costing $3,600 in total. During the quarter it sells 180 units at $25 each, for revenue of $4,500. At the end, 120 units remain. The question is how to split the $3,600 between COGS (180 units) and closing inventory (120 units).
FIFO: first in, first out
FIFO assumes the oldest units are sold first, which usually matches how goods actually move. The 180 units sold are the first 100 at $10 and 80 of the second batch at $12.
- COGS = (100 × $10) + (80 × $12) = $1,000 + $960 = $1,960
- Closing inventory = (20 × $12) + (100 × $14) = $240 + $1,400 = $1,640
- Gross profit = $4,500 − $1,960 = $2,540
When prices are rising, FIFO gives the lowest COGS and the highest profit, and the balance sheet shows inventory close to current prices.
LIFO: last in, first out
LIFO assumes the newest units are sold first. The 180 units sold are the 100 at $14 and 80 of the batch at $12.
- COGS = (100 × $14) + (80 × $12) = $1,400 + $960 = $2,360
- Closing inventory = (100 × $10) + (20 × $12) = $1,000 + $240 = $1,240
- Gross profit = $4,500 − $2,360 = $2,140
With rising prices, LIFO gives the highest COGS and the lowest profit, which means lower tax in the US, where it is permitted. The cost is a balance sheet that shows inventory at old, understated prices. LIFO is not allowed under IFRS, so businesses in the UK, EU, Australia, Canada and most other countries cannot use it.
Weighted average cost
Average cost pools all units and charges every sale at the average. Total cost $3,600 ÷ 300 units = $12 per unit.
- COGS = 180 × $12 = $2,160
- Closing inventory = 120 × $12 = $1,440
- Gross profit = $4,500 − $2,160 = $2,340
Average cost sits between the other two and smooths out price swings. It is the default in many accounting and inventory systems because it is easy to compute continuously as purchases arrive.
The three methods side by side
| FIFO | LIFO | Weighted average | |
|---|---|---|---|
| COGS | $1,960 | $2,360 | $2,160 |
| Closing inventory | $1,640 | $1,240 | $1,440 |
| Gross profit | $2,540 | $2,140 | $2,340 |
| Allowed under US GAAP | Yes | Yes | Yes |
| Allowed under IFRS | Yes | No | Yes |
| Best suited to | Perishables, fashion, most retail | US businesses with rising costs seeking tax deferral | Commodities, bulk goods, businesses using software |
Notice that the three methods only move profit between periods. Over the life of the business, once every unit is sold, total COGS equals total purchases under all three. The method decides timing, not the total.
Periodic versus perpetual systems
Separate from the costing method is when you calculate COGS.
- Periodic: you count inventory at the end of a period and back into COGS using the equation above. Simple, no software required, but you do not know your margin until you count.
- Perpetual: every sale updates inventory and COGS immediately, usually through a point-of-sale or inventory system. You see margin in real time, but you still need a physical count now and then to catch shrinkage, breakage and errors.
Most small businesses start periodic and move to perpetual once they have software that tracks units and costs. Note that FIFO and average cost give slightly different results under perpetual and periodic systems because the average is recalculated at different points; the differences are usually small.
Writing inventory down
Inventory is carried at cost, but not forever. If stock becomes damaged, obsolete or can only be sold below cost, both US GAAP and IFRS require you to write it down to the lower of cost and what you can actually sell it for, less the costs of selling (IFRS calls this net realizable value). The write-down is an expense in the period you recognize it, not when the goods are finally dumped. Review slow-moving stock at least annually and write it down honestly; an inflated inventory figure is a loan from your future profits.
Tax notes
In the US, the IRS generally requires businesses with inventory to use an inventory method consistent with their books, and a change of method requires filing for approval. The LIFO conformity rule means a business that uses LIFO for tax must also use it in its financial statements. Smaller US businesses may qualify to treat inventory as non-incidental materials and supplies under the small business taxpayer rules, which simplifies things but has its own conditions. Other countries have their own rules, and the thresholds and conditions change, so confirm your approach with an accountant before year end.
Pro tip
Add freight, duties and inbound shipping to unit cost from day one. A product that costs $10 from the supplier and $1.50 to land is an $11.50 product. Leaving that $1.50 in a general shipping expense line overstates gross margin and hides the true profitability of imported lines.
How to set up inventory accounting in six steps
- Create an inventory asset account in your accounting software, separate from expenses.
- Choose a costing method. FIFO or weighted average for most businesses; LIFO only if you are in the US and your accountant recommends it for tax.
- Record purchases to inventory, including freight and duties, not to an expense account.
- Set up a COGS account and move cost from inventory to COGS as goods sell, either per sale (perpetual) or by period-end calculation (periodic).
- Count physical stock at least once a year, and more often for high-value or fast-moving lines. Adjust the books to match reality.
- Review slow and dead stock quarterly and write down anything you cannot sell at cost.
FIFO
- Matches the physical flow of most goods
- Balance sheet reflects recent prices
- Accepted everywhere
Weighted average
- Simplest to run in software
- Smooths out price volatility
- Slightly less precise per unit
Your inventory accounting checklist
- Confirm purchases go to an inventory asset account, not an expense
- Choose FIFO or weighted average (or LIFO with advice, US only) and write the choice down
- Include freight and duties in unit cost
- Calculate COGS monthly using the equation or your perpetual system
- Schedule a full physical count and reconcile to the books
- Write down obsolete or damaged stock before year end
- Confirm tax treatment with your accountant for your country
Frequently asked questions
Which inventory method is best for a small business?
FIFO or weighted average suit almost everyone. FIFO is intuitive and keeps the balance sheet current. Weighted average is easiest if your software does it automatically. LIFO is a US-only option mainly chosen for tax deferral when costs are rising.
Can I change my inventory method later?
Yes, but it is a formal accounting change. In the US you generally need IRS approval, and under IFRS you must show the change is justified and restate prior periods. Choose carefully the first time.
Does the method change how much tax I pay overall?
Over the full life of the inventory, no. The methods change when profit is recognized, not how much. LIFO defers tax while prices rise; the deferred amount comes back if prices fall or stock levels drop.
Do service businesses need inventory accounting?
Only if they hold stock for resale or use materials that are significant in value. A consultancy does not. A repair business that holds parts usually does.
Related reading
The bottom line
Inventory is an asset until it sells, then it becomes cost of goods sold. FIFO, LIFO and weighted average are just rules for which cost moves when prices change, and they shift profit between periods rather than changing the total. Pick FIFO or average cost unless you have a specific US tax reason for LIFO, include every cost of landing the goods, count your stock and write down what will not sell. Do that and your gross margin will finally mean something.
