Cost of Goods Sold Calculator
Cost of Goods Sold Calculator
Calculate COGS from beginning inventory, purchases, and ending inventory, then review the inventory-cost bridge and export the current analysis to Excel.
Inventory inputs
Use values from the same accounting period and the same inventory valuation method.
Inventory value at the start of the period. It normally equals the previous period's ending inventory.
Inventory acquired or produced during the period, including directly attributable costs under your accounting policy.
Inventory still on hand at period end. It cannot exceed goods available without an adjustment or data mismatch.
Live results
Direct inventory cost recognized for goods sold during the period.
Inventory cost bridge
Compare the opening balance and purchases with the cost recognized and inventory retained.
Calculation detail
The bridge below cross-checks each input and the final COGS result.
| Line item | Operation | Amount | Share of goods available | Interpretation |
|---|
What this COGS calculator estimates
Cost of goods sold, commonly shortened to COGS, is the inventory cost assigned to products that were sold during an accounting period. This calculator applies the standard inventory roll-forward: start with inventory on hand, add purchases or production costs added during the period, and subtract inventory still on hand at the end. The remainder is the cost released from the balance sheet into the income statement.
COGS is not the same as total operating expense. It generally includes costs directly connected to acquiring or producing inventory, while selling, administrative, financing, and many general overhead costs are reported elsewhere. The exact boundary depends on the business, its accounting framework, and its consistently applied inventory policy.
How to enter each field
Beginning inventory
Enter the carrying value of inventory at the first day of the reporting period. For a continuous set of accounts, this should normally match the previous period's ending inventory. Use a non-negative dollar amount. A higher beginning balance increases goods available for sale and, all else equal, increases COGS. A common mistake is mixing a quantity count with a monetary value or using a balance from a different valuation method.
Purchases
Enter inventory acquired or produced during the same period. Depending on the accounting policy, this may include purchase price, direct labor, inbound freight, and allocated production overhead, net of returns, discounts, and allowances. Use the net cost added to inventory, not sales revenue. Higher purchases increase goods available and usually increase COGS unless the added inventory remains in ending stock.
Ending inventory
Enter the carrying value of unsold inventory at the close of the period. This value is subtracted because it remains an asset rather than becoming current-period expense. A higher ending balance lowers COGS; a lower ending balance raises COGS. Ending inventory should not exceed beginning inventory plus purchases unless the records omit a transfer, production addition, revaluation, or other adjustment.
Formula and practical interpretation
The first two terms create goods available for sale. The final subtraction divides that pool into two destinations: cost recognized for items sold and inventory retained for future periods. For the initial example, $10,000 of beginning inventory plus $25,000 of purchases creates $35,000 available. Subtracting $8,000 of ending inventory produces $27,000 of COGS.
The calculator also displays two proportions. Inventory cost released is COGS divided by goods available. It indicates how much of the available inventory cost moved to expense during the period. Ending inventory share is ending inventory divided by goods available. The two percentages should add to 100% when the bridge is valid.
How to read the chart and table
The bar chart compares four amounts on one scale: beginning inventory, purchases, COGS, and ending inventory. It is a comparison chart rather than a pie chart, so the bars are not intended to add to one combined total. The legend reports each exact amount, while the accessible summary exposes the same values to screen readers.
The calculation table follows the accounting bridge line by line. Beginning inventory and purchases are additions. Goods available is their subtotal. Ending inventory is the deduction. The final row is COGS. The percentage column uses goods available as the common denominator, making it easier to see how much cost was sold versus retained.
What drives a high or low COGS result
- Higher beginning inventory or purchases: raises the cost pool and generally raises COGS unless ending inventory rises by the same amount.
- Higher ending inventory: lowers current-period COGS because more cost remains on the balance sheet.
- Zero goods available: produces zero COGS and no meaningful percentage ratios.
- Ending inventory above goods available: signals inconsistent inputs; the calculator suppresses the negative result and asks you to correct the data.
A high COGS is not automatically bad. It can reflect higher sales volume, input inflation, a low-margin product mix, or inventory write-downs. A low COGS can reflect lower volume, favorable sourcing, more ending inventory, or a change in product mix. COGS is best interpreted alongside revenue, gross profit, unit volume, inventory turnover, and a consistent period-over-period accounting policy.
Common mistakes and accounting cautions
Use the same time period for all three inputs. Do not combine monthly beginning inventory with annual purchases and quarterly ending inventory. Avoid mixing FIFO, LIFO, weighted-average, standard-cost, or specific-identification values within one bridge. Confirm whether freight-in, purchase discounts, returns, production overhead, obsolete inventory, and shrinkage are included consistently.
Inventory accounting and tax treatment can vary by jurisdiction and entity type. For additional context, review the IRS guidance on accounting periods and methods, the IRS Tax Guide for Small Business, the SEC introduction to financial statements, and the Investopedia overview of COGS.
This calculator is an educational planning tool. It does not replace professional accounting, tax, audit, or legal advice, and it does not determine which costs your reporting framework permits in inventory.