Cost of Goods Sold (COGS) Calculator
Calculate COGS from inventory and purchases
Enter your inventory and purchase figures to estimate cost of goods sold. Add optional adjustments for shipping and returns. If you also enter sales revenue, you will get gross profit and gross margin.
Cost of goods sold calculator for inventory-based businesses
Cost of goods sold (COGS) is the direct cost of the products you sold during a period. If you buy products and resell them, or if you manufacture items and carry inventory, COGS is one of the most important numbers in your accounts because it drives gross profit and gross margin. When COGS is wrong, your profitability reporting is wrong, and you can end up pricing badly, ordering too much stock, or making decisions based on misleading margins.
This calculator estimates COGS using the standard inventory formula: beginning inventory plus purchases (and other purchase-related costs), minus ending inventory. The key idea is simple. You start the period with stock on hand. You then add stock you acquired during the period. At the end of the period, you count what you still have. Everything that is no longer on hand was either sold, written off, or otherwise removed. In a clean set of books, that “missing” portion is the cost of goods sold.
In practice, the tricky part is deciding which costs belong in purchases and which belong elsewhere. The calculator includes common adjustments like freight-in (shipping on purchases) and purchase returns, allowances, and discounts. These are typical items that affect the true landed cost of inventory. If you also enter sales revenue, the calculator will compute gross profit (sales minus COGS) and gross margin (gross profit divided by sales). Gross margin is often the fastest way to spot pricing problems, shrinkage, or supplier cost increases.
Assumptions and how to use this calculator
- Use figures for the same period (for example, a month, quarter, or year). Do not mix time ranges.
- Beginning inventory should match the prior period’s ending inventory, based on your stock count or your accounting system.
- Purchases should reflect inventory purchases for resale or production, not operating expenses like rent, salaries, or marketing.
- Freight-in is meant for shipping and import costs that are required to get goods into your store or warehouse. Outbound delivery to customers is usually not part of COGS.
- Ending inventory should be based on a stock count or a reliable inventory system. If ending inventory is underestimated, COGS will be overstated and margins will look worse than reality.
Common questions
What is the basic COGS formula?
The standard formula is: COGS = Beginning Inventory + Net Purchases − Ending Inventory. Net purchases typically means purchases plus freight-in, minus returns, allowances, and purchase discounts. This approach works for most retail, wholesale, and inventory-based businesses.
What is the difference between purchases and COGS?
Purchases are what you bought during the period. COGS is what you sold during the period, measured at cost. If you buy more than you sell, ending inventory increases and COGS will be lower than purchases. If you sell more than you buy, ending inventory falls and COGS can be higher than purchases.
Should labor be included in COGS?
It depends on the business. For manufacturers, direct labor used to produce goods is often included in production costs and ends up in inventory and COGS. For retailers and service businesses, most wages are operating expenses rather than COGS. If you are not tracking production costs formally, keep labor out of this calculator and treat it as an operating expense.
Why does my gross margin change when inventory changes?
Because inventory counts change the COGS figure. If ending inventory is higher, the formula subtracts a larger amount and COGS goes down, increasing gross profit. If ending inventory is lower, COGS goes up and gross profit drops. This is why accurate stock counts matter for reliable margins.
What if my COGS seems too high or too low?
Start by checking ending inventory, then confirm that purchases are inventory items only. Next, check whether freight-in and discounts are treated consistently. Finally, consider shrinkage, write-offs, and damaged stock. Those often need separate tracking, but they still affect the real economics of COGS and gross profit.