1. Home
  2. Accounting
  3. FIFO & LIFO inventory calculator

FIFO, LIFO & weighted average calculator

Enter your beginning inventory, purchases and units sold. See cost of goods sold and ending inventory for all three methods, with the steps.

Your numbers

Beginning inventory
Purchases
Cost of goods sold—

Step-by-step solution

All three methods compared
MethodCost of goods soldEnding inventory

    Have the whole problem as a photo?

    Accounting AI solves inventory problems from a picture, including perpetual systems and journal entries. 5 free questions a day.

    Download on the App Store

    What are FIFO, LIFO and weighted average?

    Inventory costing methods decide which purchase costs go to cost of goods sold (on the income statement) and which stay in ending inventory (on the balance sheet). The total is always the same: the cost of goods available for sale.

    • FIFO: the first units bought are the first sold.
    • LIFO: the last units bought are the first sold.
    • Weighted average: every unit carries the same average cost.

    The formulas

    Cost of goods available = Beginning inventory + PurchasesThen split it: COGS + Ending inventory = Cost of goods available.
    Weighted-average cost = Cost of goods available ÷ Units availableCOGS = Units sold × average cost

    Worked example

    A store starts with 100 units at $10, buys 150 units at $12 and then 200 units at $14. It sells 300 units. Goods available: 450 units costing $5,600.

    • FIFO: 100 × $10 + 150 × $12 + 50 × $14 = $3,500 COGS. Ending inventory: 150 × $14 = $2,100.
    • LIFO: 200 × $14 + 100 × $12 = $4,000 COGS. Ending inventory: $1,600.
    • Weighted average: $5,600 ÷ 450 = $12.4444 per unit. COGS: 300 × $12.4444 = $3,733.33.

    Frequently asked questions

    What is the difference between FIFO and LIFO?

    FIFO (first in, first out) assigns the oldest costs to cost of goods sold, so ending inventory holds the newest costs. LIFO (last in, first out) does the opposite: the newest costs are sold first.

    Which method gives higher profit when prices rise?

    FIFO. It matches older, cheaper costs against sales, so cost of goods sold is lower and gross profit is higher. LIFO gives the lowest profit and the lowest taxable income when prices rise.

    Is LIFO allowed under IFRS?

    No. IFRS does not allow LIFO. US GAAP allows it, and companies that use LIFO for taxes must also use it in their financial statements.

    Does this calculator use the periodic or perpetual system?

    The periodic system: cost of goods sold is calculated once, at the end of the period. Under a perpetual system, LIFO and weighted average can give different results because costs are assigned at each sale.

    Related tools