Moving Average Cost Calculator

Moving average cost (MAC) recalculates the average unit cost after each purchase by dividing the total inventory value on hand by the total units on hand. The formula: new MAC = (units on hand x previous MAC + purchase quantity x effective unit cost) / total units after the purchase. MAC does not change on a sale. Use the calculator below to simulate it across several transactions, including optional landed costs, and see the full concept guide for more examples.

A free tool to see how your inventory cost per unit changes with every purchase and sale, freight and duties included.

If you buy the same item at different prices through the year, its cost per unit is a moving target. One shipment comes in cheaper, the next comes in dearer, and the number you record as “cost” quietly drifts every time you restock. Moving average cost is the method that keeps that number honest: it re-blends your cost after each purchase, so the figure you carry is always the current average of what you actually have on hand.

Most people who reach for a calculator just want to check their own numbers, so the tool is first and the explanation second. There is also a section below on when this is more precision than your business needs.

Moving average cost calculator

What is moving average cost and how is it calculated?

Moving average cost is an inventory valuation method used in a perpetual inventory system: it updates continuously as stock moves, not once at period end. After each purchase you re-average, dividing the total value on hand by the total units on hand, and that blended figure is your cost per unit until the next purchase. The full concept guide goes deeper with more examples.

The MAC formula (perpetual system)

New MAC = (units on hand x previous MAC + purchase quantity x effective unit cost) / total units after the purchase.

“Effective unit cost” is the purchase price plus any landed cost allocated per unit. And the rule that trips people up: on a sale, MAC does not change. You record cost of goods sold at the current average and reduce your units, but the per-unit cost stays put until you buy more. The method, its perpetual timing, and the sale rule are all set out in the AccountingTools moving average method reference.

Worked example, step by step

Using the AccountingTools ABC-widgets numbers so you can check the tool against a published source:

  • Opening inventory: 1,000 units at $5.00 each. Average cost is $5.00.
  • Sell 250 units. COGS is 250 x $5.00 = $1,250. The average stays $5.00.
  • Buy 250 units at $6.00. Now blend: (750 units x $5.00 + 250 units x $6.00) / 1,000 units = $5.25. The average moves to $5.25.
  • Sell 200 units. COGS is 200 x $5.25 = $1,050. The average stays $5.25.
  • Buy 750 units at $7.00. Blend again: (800 units x $5.25 + 750 units x $7.00) / 1,550 units = $6.10. The average moves to $6.10.

The average only moves on the two purchases, to $5.25 then $6.10, exactly as the AccountingTools example reports. Load the calculator above with these figures and you should land on the same numbers.

Diagram showing moving average cost recalculated after each purchase: opening 1,000 units at $5.00, updated to $5.25 after a 250-unit purchase at $6.00, then to $6.10 after a 750-unit purchase at $7.00, while the cost holds steady through a sale.

Moving average cost vs weighted average cost, the one difference

They are the same idea applied at different frequencies. Moving average cost recalculates after every purchase, in a perpetual system. Weighted average cost recalculates once, at the end of the accounting period, in a periodic system. Same blended-average logic, different timing. If you value inventory at period end rather than transaction by transaction, the weighted average cost guide covers that version.

Does moving average cost include freight and landed costs?

It should, and most manual calculations leave it out. This is the field no other free calculator we found bothers with, and it is the one that quietly distorts margins.

What landed costs are

Landed cost is everything it takes to get goods from the supplier onto your shelf beyond the purchase price: inbound freight, customs duties, import fees, and handling. On an imported lot these can be a meaningful slice of the true cost, and they belong in the cost per unit, not buried in a general expense account where they never touch inventory value.

Why excluding them understates your true unit cost

If you average only the purchase price, your recorded cost is lower than reality, which makes your margins look better than they are and can lead you to price too low. inFlow makes the same point in its moving average cost guide: leaving freight and landed costs out of the calculation is a common mistake that understates the real cost of the goods.

How to allocate landed costs into the calculation

The straightforward way, and what the calculator does, is to spread a lot’s landed cost across the units in that lot. Take the shipment’s total freight and duties, divide by the number of units received, and add that per-unit figure to the purchase price. A lot of 100 units bought at $6.00 with $50 of freight carries $0.50 of freight per unit, so the effective cost is $6.50, and that $6.50 is what blends into your running average. Real inventory systems can allocate landed cost by value rather than a flat per-unit split when items in a shipment differ in price, but the per-unit method is the clearest way to see the effect.

Diagram illustrating per-unit landed-cost allocation: a purchase lot of 100 units at $6.00 plus $50 freight yields $0.50 per-unit landed cost, giving an effective cost of $6.50 per unit before blending into the moving average.

When to use moving average cost, and when a simpler approach is enough

Moving average cost is not the right amount of effort for every business. Here is an honest read on where it earns its place and where it does not.

When MAC is a good fit

It fits when your purchase costs move around: you buy the same item at different prices across the year, from different suppliers or in different market conditions, and you want one smooth blended cost rather than tracking every individual layer. It is lighter to run than FIFO, which makes you account for each cost layer separately, and it reflects current costs reasonably well without that bookkeeping overhead.

When a spreadsheet is genuinely enough

If you carry a small number of SKUs, your purchase prices are stable, and your volume is low, a spreadsheet updated after each purchase does the job. The formula is not hard, and there is no shame in it. Spreadsheets are how most businesses start costing their stock, and for a stable, low-volume catalogue they can stay accurate for a long time. The point at which they stop keeping up is worth naming plainly: when purchases get frequent, when landed costs vary lot to lot, or when you need current COGS across many SKUs at once, keeping a spreadsheet true by hand turns into its own job.

When to consider FIFO instead

If you are in a regulated industry and have to trace specific physical lots, or you want ending inventory valued at the most recent costs, FIFO may suit you better. Note that FIFO as an accounting method is a different thing from first-expired-first-out picking on the warehouse floor, which is about physical rotation of perishable stock, not cost. A quick note on LIFO: it is prohibited under IFRS, so for most businesses outside the US the practical choice is between moving average cost and FIFO.

Periodic or perpetual

If you would rather value inventory once at period end than after every transaction, that is periodic weighted average cost rather than perpetual MAC. Same average, calculated less often. The weighted average cost guide walks through the period-end version.

How Qoblex calculates moving average cost automatically

The calculator above is a simulator you drive by hand. Inside Qoblex, the same logic runs on live data. When you receive a purchase, Qoblex updates the item’s moving average cost automatically, so the cost per unit you see reflects what you actually have on hand right now rather than a figure someone has to maintain in a sheet.

Where Qoblex goes further than a basic calculator is landed cost. You can add freight, duties, storage, import costs, and clearance fees to a purchase order, and Qoblex factors those into the purchased goods’ moving average cost, distributing them by value across the items so the more expensive items carry a larger share of the freight. That is set out in the Qoblex purchase orders and landed costs guide. The result is a cost per unit that already includes what it took to land the goods, which is the number the manual method usually misses.

On a sale, Qoblex records COGS at the current running average and leaves the unit cost unchanged, the same rule the tool follows. Your accounting platform stays your book of record: Qoblex handles the operational inventory costing while QuickBooks Online or Xero keeps the ledger. For current plans, see qoblex.com/pricing.

FAQ

What is the moving average cost formula? New MAC = (units on hand before the purchase x previous MAC + purchase quantity x effective unit cost) / total units after the purchase. The effective unit cost includes any landed cost allocated per unit. On a sale, MAC does not change.

How is moving average cost different from weighted average cost? Moving average cost recalculates after every purchase, in a perpetual system. Weighted average cost recalculates once at the end of the period, in a periodic system. Both produce a blended average; the difference is timing. The weighted average cost guide covers the period-end version.

Does moving average cost change when you make a sale? No. Under MAC the unit cost does not change on a sale. You record COGS at the current average, reduce your units on hand, and the cost per unit stays the same until your next purchase.

How do I include freight and landed costs in moving average cost? Divide the total landed cost for a lot by the number of units in that lot to get a per-unit landed cost, then add it to the purchase price to get the effective unit cost before averaging. The calculator above does this for you when you fill in the landed-cost field.

What happens to moving average cost with negative inventory? If a sale would take units below zero, most inventory systems do not recalculate the average on the next replenishment until stock is positive again, so the negative quantity is excluded from the average. The calculator shows a warning for this edge case. See the concept guide for the full negative-stock treatment.

Is moving average cost allowed under IFRS? Yes. Both moving average (perpetual) and weighted average (periodic) are permitted under IFRS and US GAAP. LIFO is not permitted under IFRS, so for businesses under IFRS the standard options are moving average cost or FIFO.

Can I use a spreadsheet instead of software for moving average cost? For low volume, a small SKU count, and stable prices, yes: a spreadsheet updated after each purchase works, and the formula is simple. It gets harder as purchase frequency rises, as landed costs vary by lot, or when you need current COGS across many SKUs at once. That is usually the point where inventory software pays for itself.

Does Qoblex use moving average cost? Yes. Qoblex updates the moving average cost automatically when you receive a purchase, and it can factor purchase-order landed costs into that cost, as described in its landed costs guide.

How it works

Be up and running in a fraction of the time you’re expecting it to take.

Talk with our experts that have helped hundreds of product sellers just like you.

Engage an onboarding specialist to make it much easier for you.

Unlike other systems, we can get you up and running within 1 week.

Talk with our experts that have helped hundreds of product sellers just like you.

Engage an onboarding specialist to make it much easier for you.

Try Qoblex completely free for 14 days