A FIFO and LIFO calculator works out the cost of goods sold and the value of the stock left over under the two most common inventory methods. List your purchases in the order you made them, with the number of units and the cost per unit, and enter how many units you sold. The calculator shows the cost of goods sold and ending inventory under first-in, first-out (FIFO) and last-in, first-out (LIFO), the difference between them, and the gross profit under each if you add a selling price.
The FIFO and LIFO methods
FIFO: units sold are costed from the oldest purchases first
LIFO: units sold are costed from the newest purchases first
Ending inventory = total cost of purchases − cost of goods sold
Under FIFO the earliest purchased items are costed as sold first, while under LIFO the latest purchased items are costed as sold first, as the OpenStax accounting textbook and IRS Publication 538 both describe. The physical goods don't have to move in that order, because the costing is unrelated to the actual flow of the inventory; the methods are rules for assigning costs. When purchase prices change over time, the choice of method changes both the reported cost of goods sold and the value of the stock on the balance sheet.
How to use the FIFO and LIFO calculator
- List your purchases, oldest first. Put the units and the cost per unit on each line.
- Enter the number of units sold in the period.
- Optionally enter the selling price per unit.
- Choose which method to show first, and press Calculate.
Worked example
An example company, Foo Co., buys 100 units at $50, then 125 units at $55, then 75 units at $59, and sells 210 units in November. Under FIFO, the first 100 units cost $50 each ($5,000) and the next 110 cost $55 each ($6,050), so the cost of goods sold is $11,050. The 90 units left are 15 at $55 and 75 at $59, worth $5,250. Under LIFO, the 75 newest units cost $4,425, the next 125 cost $6,875 and the last 10 cost $500, so the cost of goods sold is $11,800 and the 90 units left, all at $50, are worth $4,500. The difference, $750, is the LIFO reserve.
Effect on profit and tax
When prices are rising, as OpenStax and IRS Publication 538 explain, FIFO gives a higher ending inventory value and a lower cost of goods sold, which means a higher gross profit and a higher income tax expense. LIFO does the opposite: it matches the newest, higher costs against sales, which lowers reported profit and tax. In the example, with a selling price of $80 a unit, gross profit is $5,750 under FIFO and $5,000 under LIFO. When prices are falling, the effects reverse.
Where LIFO is allowed
LIFO is available under US accounting rules, and a US business adopts it for tax by filing Form 970 or an equivalent statement with its tax return. International Financial Reporting Standards do not permit LIFO, so companies that report under those standards use FIFO or another method. That is why the calculator shows both methods side by side: you can see the difference, but you should check which method your accounting framework and tax authority allow before using it.
The LIFO reserve
Companies that use LIFO often disclose the LIFO reserve, the amount by which inventory would be higher under FIFO. In the example it is $5,250 − $4,500 = $750. Analysts add the reserve back to compare a LIFO company with one that uses FIFO, because otherwise the two companies' inventory values and profits are measured differently. A growing reserve over time is a sign that purchase prices have been rising.
Recording purchases
Enter each purchase as it happened, including returns as reductions to the units of the batch they came from, and leave out any purchases made after the sales you are costing. The calculator treats the whole list as one period, so if sales happened at different times between purchases, a perpetual record that costs each sale when it happens can give a different answer for LIFO. For profit margins, the gross margin calculator helps, and for the cost of goods sold formula with opening and closing stock, use the COGS calculator.
Choosing between the methods
FIFO often matches the way goods physically move when a business sells its oldest stock first, and it keeps the balance sheet value close to recent prices. LIFO matches recent costs against current sales, which gives a closer picture of current margins when prices are rising. Once a business chooses a method, it normally has to keep using it consistently, so the choice deserves care.
Checking your answer
A quick check is that the cost of goods sold plus the ending inventory must equal the total cost of all purchases under both methods, because every unit is either sold or still in stock. In the example, $11,050 plus $5,250 and $11,800 plus $4,500 both come to $16,300. If prices were the same for every purchase, the two methods would give identical answers.
Common mistakes
- Listing purchases out of order. Put the oldest first.
- Selling more than was bought. Include opening stock as the first line.
- Using totals instead of unit costs. Enter the cost per unit for each batch.
- Assuming LIFO is allowed everywhere. It isn't permitted under IFRS.
What next
Use this often? Add FIFO and LIF to your Home screen.
Frequently asked questions
How does a FIFO and LIFO calculator work?
It costs the units sold from your oldest purchases first (FIFO) or newest first (LIFO) and values the rest as ending inventory.
What is the FIFO cost of goods sold in the Foo Co. example?
$11,050, leaving ending inventory of $5,250.
What is the LIFO cost of goods sold in the same example?
$11,800, leaving ending inventory of $4,500, a LIFO reserve of $750.
Which method gives higher profit when prices rise?
FIFO, because it charges the older, cheaper costs to cost of goods sold.
Is LIFO allowed everywhere?
No. It is permitted under US rules, but IFRS does not permit it.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.