The Ending Inventory Calculator calculates the value of stock remaining at the end of an accounting period using starting inventory, net purchases, and cost of goods sold. It also calculates inventory turnover for the same period.
Ending inventory, also called closing inventory or ending stock, is a dollar value—not a unit count or the amount you could earn by selling the remaining goods.

How to use the ending inventory calculator
Choose one accounting period, such as a month, quarter, or year, and enter these three amounts:
- Starting Inventory: The recorded value of inventory at the beginning of the period. This normally matches the previous period’s ending inventory, subject to any adjustments.
- Net purchases: Inventory purchases during the period, less purchase returns, allowances, and purchase discounts. Include inbound freight and other acquisition costs where your accounting policy includes them in inventory cost.
- Cost of Goods Sold: The cost assigned to goods sold during that period—not sales revenue or the selling price of those goods.
The fields display dollar amounts. Use the same currency, accounting period, and inventory costing method throughout. Do not mix inventory recorded at cost with sales figures recorded at retail prices.
This calculator works from monetary totals. It does not determine cost of goods sold from purchase batches, unit quantities, or individual product records.
Ending inventory formula and worked example
The ending stock formula is:
Ending inventory = Starting inventory + Net purchases − Cost of goods sold
Starting inventory plus net purchases gives the cost of goods available for sale. Subtracting the cost assigned to goods sold leaves the value of the remaining stock.
For example, suppose a retailer has the following figures for a quarter:
| Item | Amount |
|---|---|
| Starting inventory | $30,000 |
| Net purchases | $40,000 |
| Cost of goods available for sale | $70,000 |
| Cost of goods sold | $45,000 |
| Ending inventory | $25,000 |
Ending inventory = $30,000 + $40,000 − $45,000 = $25,000
The $25,000 represents the calculated carrying value of inventory remaining at quarter-end. It is not gross profit, cash on hand, or expected sales revenue.
How the calculator calculates inventory turnover
Inventory turnover compares cost of goods sold with average inventory. This calculator uses the average of the opening and closing balances:
Average inventory = (Starting inventory + Ending inventory) ÷ 2
Inventory turnover = Cost of goods sold ÷ Average inventory
Using the same example:
- Average inventory = ($30,000 + $25,000) ÷ 2 = $27,500
- Inventory turnover = $45,000 ÷ $27,500 ≈ 1.64 times
The business sold goods costing about 1.64 times its average inventory value during the quarter. Because the inputs cover a quarter, this is quarterly turnover—not annual turnover.
Higher turnover can indicate faster stock movement, but it can also accompany insufficient stock and missed sales. Lower turnover may reflect slow-moving goods, seasonal stock building, or a deliberate inventory buffer. Compare similar periods and product categories rather than applying a universal “good” ratio.
The two-point average can miss large inventory changes within a period. If stock levels fluctuate significantly, an average based on monthly or more frequent balances may be more representative. Turnover is undefined when average inventory is zero.
How to calculate ending inventory using FIFO
The closing inventory formula stays the same under different costing methods. What changes is the cost assigned to goods sold and to the units remaining.
Under FIFO, or first in, first out, the earliest inventory costs are assigned to cost of goods sold first. Ending inventory therefore consists of the most recent cost layers. This is a cost-flow assumption; it does not necessarily describe the physical order in which goods leave a warehouse.
For example, assume you start with 100 units costing $10 each, buy another 100 units costing $12 each, and sell 120 units:
- Starting inventory: 100 × $10 = $1,000
- Net purchases: 100 × $12 = $1,200
- FIFO cost of goods sold: (100 × $10) + (20 × $12) = $1,240
- Ending inventory: 80 remaining units × $12 = $960
Entering $1,000, $1,200, and $1,240 into this calculator gives $960. To calculate costs from purchase layers rather than enter an existing COGS total, use the FIFO inventory calculator.
Other inventory costing methods
- LIFO: Assigns the latest inventory costs to goods sold first, leaving older cost layers in ending inventory. The LIFO inventory calculator helps calculate those values.
- Weighted average cost: Under a periodic approach, divide the total cost of goods available for sale by the total units available. Multiply that average unit cost by the remaining units to value ending inventory.
- Specific identification: Uses the actual recorded cost of each remaining item. This is useful for distinguishable items such as vehicles, jewelry, or custom equipment.
Use the costing method appropriate to your accounting requirements consistently. Different methods can produce different inventory values and COGS when purchase costs change.
Checking and applying your results

A calculated balance is useful for period-end reconciliation and purchasing decisions, but it does not replace a physical count or a review of inventory records.
- Investigate a negative result. It means the COGS entered exceeds starting inventory plus net purchases. Check for missing purchases, incorrect dates, or sales revenue mistakenly entered as COGS.
- Reconcile differences. Theft, damage, counting errors, write-downs, and transfers can make recorded inventory differ from actual inventory. The calculator has no separate inputs for these adjustments.
- Review rising balances alongside demand. More ending stock may support future sales, but it can also tie up cash and increase storage or obsolescence costs. Check product-level sales and reorder needs before buying more.
- Avoid circular calculations. If your COGS was calculated using an estimated ending inventory, entering that COGS here only reproduces the estimate; it does not independently verify it.
For further analysis, use the inventory turnover calculator to examine stock movement, or the Days Inventory Outstanding Calculator to express inventory holding time in days.
Build an inventory savings estimator for your website
Inventory consultants and fulfillment providers can use Calcopolis to build a custom savings calculator that estimates carrying-cost reductions from lower average inventory, helping prospects assess potential savings before requesting a quote.