Inventory Costing Calculator
Enter purchases and sales, choose FIFO, LIFO, or Weighted Average Cost under Perpetual or Periodic systems, and get a full cost flow table, COGS, ending inventory, and journal entries — with side-by-side method comparison.
Background
When identical units are purchased at different prices, a business must choose which cost to assign to units sold (COGS) and which to keep on the balance sheet (ending inventory). The three main methods — FIFO, LIFO, and Weighted Average Cost — produce different results and have real financial statement consequences. Under Perpetual inventory, COGS is updated with every sale. Under Periodic inventory, COGS is calculated only at period end.
How to use this calculator
- Choose Perpetual if COGS is tracked after each sale, or Periodic if it's calculated at period end. Use Compare both to see all differences at once.
- Select your costing method: FIFO (oldest costs out first), LIFO (newest costs out first), or Weighted Average.
- Enter any beginning inventory on hand, then add purchases and sales in date order.
- Click Calculate to see the full cost flow table, COGS, ending inventory value, and journal entries.
How each method works
FIFO (First In, First Out): The oldest (first purchased) units are assumed sold first. During rising prices, FIFO produces lower COGS and higher net income. Ending inventory reflects the most recent, higher costs.
LIFO (Last In, First Out): The newest (most recently purchased) units are assumed sold first. During rising prices, LIFO produces higher COGS and lower net income, reducing taxes. Note: LIFO is not permitted under IFRS.
Weighted Average Cost: All available units are averaged together. Under Perpetual, the average is recalculated after each purchase (moving weighted average). Under Periodic, one average is computed for the entire period.
Formulas used
COGS (Periodic): COGS = Beginning Inventory + Purchases − Ending Inventory
Weighted Average Cost per unit (Periodic): WAC = Total Cost Available ÷ Total Units Available
Moving Average (Perpetual): New avg = (Units on hand × Old avg + Units purchased × Purchase price) ÷ New total units
Ending Inventory check: Beginning Inventory + Purchases − COGS = Ending Inventory
Example problems
Rising prices — FIFO vs. LIFO
When purchase prices rise over time, FIFO assigns the old (cheaper) costs to COGS and keeps the new (expensive) costs in ending inventory. LIFO does the opposite — higher recent costs go to COGS, reducing taxable income.
Perpetual vs. Periodic — when do they differ?
FIFO produces identical results under both systems because the same (oldest) units leave regardless of timing. LIFO and Weighted Average can produce different results because the timing of sales relative to purchases changes which layers are available.
Weighted Average under Perpetual
Each new purchase triggers a recalculation of the average cost per unit. This "moving average" is then used for the next sale, making it more responsive to price changes than the single periodic average.
Financial statement effects
In rising price environments: FIFO → highest net income, highest ending inventory. LIFO → lowest net income, lowest ending inventory (better for taxes). Weighted Average falls in between. All three produce the same total over the full life of the inventory.
Frequently Asked Questions
Does FIFO or LIFO give a higher ending inventory?
In rising price environments, FIFO gives a higher ending inventory value because it retains the most recently purchased (more expensive) units on the balance sheet.
Is LIFO allowed under IFRS?
No. LIFO is prohibited under IFRS. It is only permitted under US GAAP. This is one of the key GAAP vs. IFRS differences tested in accounting courses.
When does FIFO give the same result under Perpetual and Periodic?
Always. Because FIFO always sends the oldest costs to COGS regardless of when the sale occurs, the timing of sales within the period does not change the outcome.
What is a LIFO reserve?
The LIFO reserve is the difference between inventory valued under FIFO and under LIFO. Companies using LIFO must disclose this in their financial statements so analysts can compare them to FIFO-based competitors.