Ending Inventory Calculator - COGS Stock Check

Use this ending inventory calculator to roll forward stock cost from beginning inventory, purchase adjustments, and COGS.

Updated: June 7, 2026 • Free Tool

Ending Inventory Calculator

$

Inventory cost on hand at the start of the period.

$

Gross merchandise or production inventory purchases.

$

Inbound freight, cartage, or similar acquisition cost.

$

Supplier returns, allowances, or purchase credits.

$

Discounts treated as reductions of purchase cost.

$

Sales for the same period, used for margin checks.

$

COGS for the same period and cost basis.

Results

Ending inventory
$0
Goods available for sale $0
Net purchases $0
Gross profit $0
Gross margin 0%
Ending inventory to sales 0%
Result status 0

What Is Ending Inventory Calculator?

An ending inventory calculator estimates the inventory cost left at the end of a period after beginning inventory, purchase activity, and cost of goods sold are rolled together. Use it when you are closing a month, checking a retail stock ledger, preparing a Schedule C worksheet, or reviewing whether a COGS number is consistent with the inventory available for sale.

  • Monthly close: Roll beginning inventory forward with purchases, freight-in, returns, discounts, and COGS before journal entries are reviewed.
  • Small business tax prep: Check that closing inventory and COGS tell the same story before records go to a tax preparer.
  • Retail stock review: Compare the remaining inventory cost with sales to spot a stock level that may be unusually high or low.
  • Gross profit review: Use the same COGS input to review gross profit and gross margin alongside the ending stock estimate.

This calculator works from accounting totals, not item-by-item warehouse counts. It assumes the COGS value has already been prepared on the cost method your books use, such as FIFO, LIFO where allowed, weighted average, specific identification, or retail inventory.

Treat the result as a bookkeeping check. A physical count, an inventory subledger, or a formal inventory valuation may still be needed when stock is damaged, obsolete, miscounted, consigned, or subject to lower-of-cost valuation rules.

After you estimate closing stock, the Days Inventory Outstanding Calculator converts inventory and COGS into the number of days stock is typically held.

How Ending Inventory Calculator Works

The calculation starts with goods available for sale, then subtracts the cost assigned to goods sold during the same period.

Ending inventory = Beginning inventory + Purchases + Freight-in - Purchase returns - Purchase discounts - COGS
  • Beginning inventory: The cost of inventory on hand at the start of the period.
  • Purchases: Gross inventory acquired for resale or production during the period.
  • Freight-in: Inbound shipping or cartage that belongs in acquisition cost.
  • Purchase returns and discounts: Credits and discounts that reduce the net cost of purchases.
  • COGS: Inventory cost expensed for goods sold during the same period.

The calculator also reports goods available for sale. That subtotal is important because COGS cannot exceed it without creating a negative ending inventory, which usually means the inputs are not from the same period or the same cost basis.

Gross profit and gross margin are included as cross-checks. They do not replace an income statement, but they make it easier to see whether the entered COGS creates a margin that fits the business.

Retail month-end example

Beginning inventory is $20,000, purchases are $80,000, freight-in is $2,000, purchase returns are $3,000, purchase discounts are $1,000, sales are $150,000, and COGS is $70,000.

Net purchases = $80,000 + $2,000 - $3,000 - $1,000 = $78,000. Goods available = $20,000 + $78,000 = $98,000. Ending inventory = $98,000 - $70,000 = $28,000.

The ending inventory estimate is $28,000, with gross profit of $80,000 and gross margin of 53.33%.

If the physical count or inventory system shows a very different amount, review cut-off dates, supplier credits, freight coding, shrinkage, and the COGS entry before closing the books.

According to IRS Publication 334, cost of goods sold is the cost of goods available for sale minus closing inventory, and freight-in on merchandise bought for resale is part of cost of goods sold.

If your COGS input is the uncertain number, the COGS Calculator works through the related cost-of-goods-sold rollforward from the other direction.

Key Concepts Explained

These concepts keep the rollforward consistent with the way inventory moves through accounting records.

Goods available for sale

This is beginning inventory plus net purchases. It is the pool of inventory cost that can either remain on the balance sheet or move to COGS.

Net purchases

Net purchases include purchase cost plus inbound freight, reduced by supplier returns, allowances, and discounts handled as purchase-cost reductions.

Cost flow method

FIFO, LIFO, weighted average, specific identification, and retail inventory methods can produce different COGS and ending inventory amounts from the same physical stock.

Book amount versus count

A rollforward is a book estimate. Physical counts, shrinkage adjustments, damaged goods, or valuation write-downs can change the final reported inventory.

Keep every input on the same accounting basis. Mixing a tax COGS number with a management-reporting purchase file can produce an ending inventory amount that looks precise but is not meaningful.

The cost flow method matters most when purchase costs change during the period. In a rising-cost period, FIFO often leaves newer, higher costs in ending inventory, while LIFO can leave older costs in closing stock where LIFO is permitted.

When the question shifts from ending stock value to selling speed, the Inventory Turnover Ratio Calculator compares COGS with average inventory.

How to Use This Calculator

Use the ending inventory calculator in the same order as an inventory rollforward so period cut-off errors are easier to spot.

  1. 1 Enter beginning inventory: Use the ending inventory from the prior period unless an adjustment has been posted and documented.
  2. 2 Add gross purchases: Enter merchandise or production inventory acquired during the same period.
  3. 3 Add freight-in: Include inbound shipping, express, or cartage costs that your accounting policy treats as inventory acquisition cost.
  4. 4 Subtract purchase adjustments: Enter supplier returns and purchase discounts so the calculator uses net purchases.
  5. 5 Enter sales and COGS: Use the net sales and COGS for the same date range and cost basis as the inventory inputs.
  6. 6 Review the checks: Compare ending inventory, goods available, gross margin, and inventory-to-sales before relying on the result.

Suppose a store closes April with $28,000 of estimated ending inventory and $150,000 of net sales. The inventory-to-sales output is 18.67%, so the owner can compare that level with prior months before ordering more stock.

For retail buying decisions, the GMROI Calculator connects gross margin dollars with the inventory investment that produced them.

Benefits of Using This Calculator

The output is useful when it turns raw accounting totals into checks a manager or bookkeeper can act on.

  • Close periods with fewer surprises: A quick rollforward shows whether COGS and purchase records leave a plausible ending inventory amount before reports are distributed.
  • Separate purchase effects: Freight-in, returns, and discounts are visible inputs, so purchase-cost adjustments are not buried inside one net number.
  • Connect inventory to profitability: Gross profit and gross margin show how the same COGS value affects income statement review.
  • Flag stock pressure: The inventory-to-sales result helps highlight periods when remaining stock may be thin, heavy, or inconsistent with normal sales volume.
  • Support cleaner handoffs: The formula and intermediate outputs make it easier to explain assumptions to a bookkeeper, CPA, controller, or inventory manager.

The ending inventory calculator is most helpful before a formal close or after a new COGS estimate arrives. If the ending inventory amount does not match the warehouse count, the next step is investigation, not forcing the calculator result into the books.

Use the gross margin output as a reasonableness check. A sudden margin change can point to missing purchase credits, freight coded to the wrong account, markdowns, shrinkage, or a COGS estimate that needs support.

If the main concern is product profitability rather than stock value, the Gross Margin Calculator focuses on revenue, COGS, and margin percentage.

Factors That Affect Your Results

Ending inventory depends on both math and accounting policy. The formula is simple, but the inputs need judgment.

Period cut-off

Purchases, freight, returns, sales, and COGS must all belong to the same period. Late invoices and shipments in transit often create differences.

Cost flow method

FIFO, weighted average, specific identification, LIFO where allowed, and retail inventory can assign different costs to the same physical goods.

Freight and other acquisition costs

Inbound costs may belong in inventory cost. Outbound delivery to customers usually belongs elsewhere, so classify shipping carefully.

Shrinkage and count adjustments

The formula does not know about theft, spoilage, breakage, miscounts, or obsolete items unless those amounts are already reflected in COGS or adjustments.

Valuation write-downs

Inventory may need write-downs when expected selling value falls below cost. That accounting decision is outside a simple rollforward.

  • This is not a substitute for a physical inventory count, inventory subledger, or professional accounting review.
  • The calculator does not choose FIFO, LIFO, weighted average, retail inventory, or lower-of-cost valuation adjustments for you.
  • The result is only as reliable as the COGS, purchase, freight, and discount entries supplied for the same period.

For tax and financial reporting, inventory policies can affect income. If you change methods, handle obsolete stock, or capitalize additional production costs, consult the rules that apply to the entity and reporting framework.

A clean result should still be compared with operational records. Inventory software, receiving reports, supplier credits, and count sheets often explain why a book rollforward differs from stock on the shelf.

According to IRS Publication 538, businesses that account for inventory need methods for identifying and valuing items, and the valuation method must clearly reflect income.

According to IFRS IAS 2 Inventories, inventories are measured at the lower of cost and net realisable value, and cost includes purchase, conversion, and other costs needed to bring inventory to its present location and condition.

Once inventory and COGS are reviewed, the Profit Calculator extends the analysis to operating costs and net profit.

ending inventory calculator showing stock cost, COGS, and gross margin
ending inventory calculator showing stock cost, COGS, and gross margin

Frequently Asked Questions

Q: How do you calculate ending inventory?

A: Calculate net purchases first: purchases plus freight-in minus purchase returns and purchase discounts. Add net purchases to beginning inventory to get goods available for sale. Then subtract COGS. The remaining amount is estimated ending inventory for the period.

Q: Can I calculate ending inventory if I only know COGS?

A: You also need beginning inventory and net purchases. COGS by itself tells you the cost assigned to goods sold, but it does not show how much inventory was available before those goods were sold.

Q: Do purchase returns reduce ending inventory?

A: Yes, purchase returns and allowances reduce net purchases in the rollforward. They lower goods available for sale before COGS is subtracted, so they can reduce the ending inventory estimate when all other inputs stay the same.

Q: Is freight-in included in ending inventory?

A: Inbound freight can be part of inventory acquisition cost when it relates to merchandise or materials bought for resale or production. Keep it separate from outbound delivery to customers, which is usually handled outside inventory cost.

Q: Why does ending inventory affect gross profit?

A: Ending inventory and COGS are linked. If more goods remain in ending inventory, less cost is assigned to goods sold, which can raise gross profit. If ending inventory is lower, COGS is higher and gross profit falls.

Q: Is this the same as FIFO or LIFO ending inventory?

A: No. This calculator uses totals after your cost flow method has already been applied. FIFO, LIFO where allowed, weighted average, specific identification, or retail inventory methods can produce different COGS and ending inventory inputs.