FIFO / LIFO Calculator
Work out cost of goods sold and ending inventory under FIFO and LIFO from purchase layers, units@cost, units sold. FIFO sells the oldest layer first; LIFO sells the newest; cost of goods sold = Σ units taken × layer cost, and the page prints the substitution so the result can be checked by hand.
FIFO / LIFO Calculator
Work out cost of goods sold and ending inventory under FIFO and LIFO from purchase layers, units@cost, units sold. FIFO sells the oldest layer first; LIFO sells the newest; cost of goods sold = Σ units taken × layer cost, and the page prints the substitution so the result can be checked by hand.
How this page computes
FIFO sells the oldest layer first; LIFO sells the newest; cost of goods sold = Σ units taken × layer cost
The units left are the same under both methods; only which layer the sold units came from differs, and that is what moves the cost between the two lines.
The page prints both methods side by side, so the tax and reporting difference is visible rather than asserted.
The calculation runs entirely in this browser tab; nothing is uploaded.
FIFO / LIFO Calculator computes cost of goods sold and ending inventory under FIFO and LIFO. FIFO sells the oldest layer first; LIFO sells the newest; cost of goods sold = Σ units taken × layer cost. The page prints the rule, the numbers substituted into it and the result, so the arithmetic can be checked by hand.
The units left are the same under both methods; only which layer the sold units came from differs, and that is what moves the cost between the two lines. Pressed with purchase layers, units@cost 10@5, 20@6, units sold 15, it answers: Units available = 30; units sold = 15; units left = 15
How to use FIFO / LIFO Calculator
Enter purchase layers, units@cost 10@5, 20@6, units sold 15, then press Run: the page evaluates cost of goods sold and ending inventory under FIFO and LIFO and prints every line of the working. Typed input is read exactly as written, and a blank field is refused with its name.
Read the first line as the answer and the lines below it as the substitution. If a value is out of range the page refuses it by field and reason instead of printing a number.
With purchase layers, units@cost 10@5, 20@6, units sold 15, the answer is Units available = 30; units sold = 15; units left = 15.
One list, two answers
The units left are the same under both methods; only which layer the sold units came from differs, and that is what moves the cost between the two lines.
The page prints both methods side by side, so the tax and reporting difference is visible rather than asserted.
What to Expect
Best for
- Working out cost of goods sold and ending inventory under FIFO and LIFO without a spreadsheet
- Checking a figure someone else quoted
- Seeing the formula behind an answer
Not ideal for
- A layer not written as units@cost, or a sold count above the units on hand, is refused with the offending layer or count.
- A quantity the page cannot compute, which it refuses instead of estimating
- Rounding an answer that has an exact form
What this tool keeps
- FIFO sells the oldest layer first; LIFO sells the newest; cost of goods sold = Σ units taken × layer cost
- Every input exactly as typed
What may need cleanup
- Nothing: the printed answer is the final output
- A unit conversion, if the inputs were entered in different units
Common errors
- A layer not written as units@cost, or a sold count above the units on hand, is refused with the offending layer or count.
- An empty field is refused with the field's name
Example use cases
- Work out cost of goods sold and ending inventory under FIFO and LIFO for one set of inputs
- Check the result against the formula by hand
- See which input the answer is most sensitive to
Sample input
FIFO / LIFO Calculator: purchase layers, units@cost 10@5, 20@6, units sold 15
Sample output
Units available = 30; units sold = 15; units left = 15 — FIFO cost of goods sold = 80.00; ending inventory = 90.00
Who this is for
- Students checking a formula
- Anyone who needs the number and the working
Frequently asked questions
What formula does this page use?
FIFO sells the oldest layer first; LIFO sells the newest; cost of goods sold = Σ units taken × layer cost. The page prints the substitution as well, so the answer can be checked against the rule.
What does FIFO / LIFO Calculator refuse?
A layer not written as units@cost, or a sold count above the units on hand, is refused with the offending layer or count.
What does the default example give?
Purchase layers, units@cost 10@5, 20@6, units sold 15 gives Units available = 30; units sold = 15; units left = 15. Every line below that restates the same arithmetic.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.