Weighted Average Inventory Cost Calculator
Enter the quantity and unit price for each purchase batch to get average cost, total quantity, and total amount; add current stock to find inventory value.
Purchase Batches
Quantity and price must be non-negative numbers entered together on each row. At least one row needs a quantity above 0, and current stock cannot be negative.
The calculation exceeded the maximum limit. Please try smaller numbers.
Enter your current stock quantity to display the inventory value.
Note: Sales do not change the average cost, and sold purchase batches remain included in the average, matching the exact formula used in Inventory & Unit Cost Tracker.
Formula, Example, and Scope
This weighted average cost calculator finds unit cost across all purchase batches using the formula: Average cost = Total purchase amount ÷ Total purchase quantity. Outgoing sales only reduce quantity on hand and do not change the average cost; sold batches still count toward the average. Example: First, buy 10 units at a unit price of 10, then sell 8 units, and later buy a second batch of 10 units at a unit price of 20. Total purchase quantity is 10 + 10 = 20 and total purchase amount is 10 × 10 + 10 × 20 = 300, so average cost = 300 ÷ 20 = 15. Selling 8 units leaves the average cost at 15. With current stock at 10 − 8 + 10 = 12, inventory value = 12 × 15 = 180.
Scope and limitations: This browser calculator averages up to 30 purchase batches without a separate opening balance field, and it does not recalculate a moving average after each individual sale. If you already have an opening stock quantity and opening average cost to combine with new purchases and sales across up to 30 items, use the free Excel (.xlsx) stock sheet below, which includes opening stock in its average cost formula.