What Is Moving Average in Accounting: Formula and FIFO/LIFO

The moving average method in accounting is an inventory costing technique that recalculates a single blended cost per unit every time you receive a new purchase, pooling the cost of what’s already on the shelf with the cost of what just arrived. Cost of goods sold and ending inventory then reflect that smoothed weighted average rather than the price of any specific batch. Both U.S. Generally Accepted Accounting Principles and International Financial Reporting Standards permit the weighted average approach, and the IRS accepts it for federal tax purposes when certain safe harbor conditions are met.1Internal Revenue Service. Revenue Procedure 2008-43

How the Method Works

Every time a shipment arrives, you combine the dollar value of the inventory you already hold with the total cost of the new purchase, then divide by the combined unit count. That produces one updated cost per unit that applies to every unit in stock until the next purchase triggers another recalculation. Sales do not trigger a recalculation. Units leave inventory at whatever the current average happens to be at the moment of sale.

The pooling is the point. If you buy 500 widgets at $8 in January and 500 more at $12 in March, your per-unit cost lands at $10. You never have to decide whether the cheap ones or the expensive ones left the warehouse first, and your reported margins don’t swing every time a supplier changes prices.

The Formula

You need four figures: units currently in stock, their total dollar value, units arriving, and the total cost of those arriving units (including freight and handling).

New cost per unit = (Total value of existing inventory + Total cost of new purchase) ÷ (Existing units + New units)

Worked Example

Say your warehouse holds 200 units valued at $10 each, for total inventory value of $2,000. A new shipment of 100 units arrives at $13 per unit, costing $1,300. The updated average is:

($2,000 + $1,300) ÷ (200 + 100) = $3,300 ÷ 300 = $11.00 per unit

Every unit on the shelf is now carried at $11.00. Sell 150 units before more stock arrives and your cost of goods sold is 150 × $11.00 = $1,650. Remaining inventory: 150 units at $11.00 = $1,650.

Another shipment lands: 200 units at $14 each, totaling $2,800. Recalculate:

($1,650 + $2,800) ÷ (150 + 200) = $4,450 ÷ 350 = $12.71 per unit

The cycle repeats with every purchase.

Discounts, Returns, and Freight

These adjustments have to go into the pool correctly, because every dollar of error carries forward into every future recalculation. Purchase discounts for early payment reduce the cost recorded in inventory: an $1,800 purchase with a $54 early-payment discount enters the books at $1,746. Freight and handling get folded into the total purchase cost before you run the average. Returned units come back out in reverse, pulling both the units and their associated cost out of the pool before the next average is computed.

Moving Average vs. FIFO and LIFO

Each of the three main inventory costing methods assumes something different about which units left the warehouse, and that assumption drives everything downstream.

  • FIFO (first-in, first-out): Assumes the oldest inventory ships first. When prices are rising, FIFO assigns lower costs to goods sold and leaves higher-cost units on the balance sheet. Higher reported profit, higher tax bill.
  • LIFO (last-in, first-out): Assumes the newest inventory ships first. Rising prices push higher costs into cost of goods sold and lower taxable income. LIFO is permitted under U.S. GAAP but not under IFRS.
  • Moving average: Makes no assumption about which units ship. Every unit on the shelf carries the same blended cost, and results usually land between FIFO and LIFO.

Moving average has a practical edge in high-volume operations. Because every unit shares one cost, there are no separate cost layers to track. A warehouse shipping thousands of identical parts a day doesn’t need software to identify which batch each unit came from. The tradeoff is precision: FIFO’s ending inventory figure tracks closer to current replacement cost, while moving average blends older costs into the current number and can slightly understate inventory value when prices climb steadily.

You Need a Perpetual Inventory System

The method only works inside a perpetual inventory system that records every purchase and every sale as it happens. A new average must be computed at each purchase, so the system needs the current unit count and total value at all times. Periodic systems that update only at month-end or quarter-end can’t support continuous recalculation. In practice this means inventory management or ERP software with timestamped records. That log becomes your audit trail: if an examiner asks how you arrived at a particular cost of goods sold figure, you need to be able to show each purchase, each recalculation, and each sale.

IRS Safe Harbors

The IRS accepts a rolling-average inventory method for federal tax purposes when it “clearly reflects income.” Revenue Procedure 2008-43 sets out two safe harbors that automatically satisfy that standard.1Internal Revenue Service. Revenue Procedure 2008-43 First, you must recalculate the average cost of each inventory item either every time you purchase or produce more units, or on a regular schedule no less frequently than monthly. Second, you must meet one of these two tests:

  • Variance test: The difference between your ending inventory valued at rolling-average cost and the same inventory valued at FIFO (or specific identification) cost must not exceed one percent of the aggregate rolling-average cost.
  • Turnover test: Your entire inventory must turn at least four times per year, calculated as cost of goods sold divided by average inventory (the average of beginning and ending inventory).

Fast-moving stock easily clears the turnover threshold. If your inventory sits for extended periods or costs swing hard, the IRS may find that the rolling-average method does not clearly reflect income in your situation, and the variance test becomes the benchmark to watch.1Internal Revenue Service. Revenue Procedure 2008-43

Small Businesses May Not Need This At All

Under Section 471(c) of the Internal Revenue Code, businesses that meet the gross receipts test in Section 448(c) can skip formal inventory accounting rules entirely.2Office of the Law Revision Counsel. 26 USC 471 – General Rule for Inventories For tax years beginning in 2026, that threshold is $32 million in average annual gross receipts over the prior three years.3Internal Revenue Service. Rev. Proc. 2025-32 – 2026 Adjusted Items

Businesses below that line have two simplified options: treat inventory as non-incidental materials and supplies (essentially deducting the cost when items are used or sold), or follow whatever method matches their financial statements or internal books. Either approach is treated as clearly reflecting income for tax purposes.2Office of the Law Revision Counsel. 26 USC 471 – General Rule for Inventories If that’s your situation, the perpetual-system overhead and weighted-average recalculations may be more machinery than you need.

Switching to the Moving Average Method

If your business currently uses FIFO, LIFO, or another cost-flow method and wants to adopt moving average, the IRS treats that as a change in accounting method. You can’t just start using a new formula mid-year. You file Form 3115, Application for Change in Accounting Method, and attach the original to your timely filed federal income tax return for the year the change takes effect.4Internal Revenue Service. About Form 3115, Application for Change in Accounting Method A signed duplicate copy goes to the IRS National Office.

For inventory valuation changes specifically, complete Schedule D of Form 3115 along with Parts I and II. Revenue Procedure 2008-43 assigns this change an automatic consent number (DCN 114), so advance IRS approval isn’t required as long as you follow the filing procedures.1Internal Revenue Service. Revenue Procedure 2008-43 The change generally uses a cut-off method, meaning you apply the new average going forward without restating prior years, unless your records support a retroactive adjustment under Section 481(a).