How to use the cogs calculator
- Enter your beginning inventory at cost for the period.
- Enter purchases during the period. Add freight in and returns and discounts if they apply.
- Enter your ending inventory at cost.
- Optionally enter sales to see gross profit and COGS as a share of sales.
Formula
Goods available for sale = beginning inventory + purchases + freight in - returns and discounts
Cost of goods sold = goods available for sale - ending inventory
Gross profit = sales - cost of goods sold
COGS percent of sales = COGS / sales x 100%
This is the periodic inventory method. It uses the inventory counts you enter and does not pick a costing method such as FIFO.
$10,000 + $40,000 - $12,000
A shop starts the period with $10,000 of inventory, buys $40,000 more and ends with $12,000 on hand. Goods available for sale are $50,000, so cost of goods sold is $50,000 - $12,000 = $38,000.
With sales of $60,000, gross profit is $22,000, COGS is 63.33% of sales and the gross margin is 36.67%. If you also paid $2,000 in freight in and got $500 back in returns, goods available become $51,500 and COGS rises to $39,500.
What goes into COGS
Cost of goods sold is the cost of the products you actually sold during the period. It starts with what you had, adds what you bought and brings in costs of getting the goods to your door, then subtracts what is still on the shelf. What remains is the cost of what left.
Because the formula works from inventory counts, an error in the ending count carries straight into COGS and into profit. Counting carefully at the end of each period matters more than the arithmetic.
What the formula leaves out
Which costs count as inventory, such as direct labor or overhead for a manufacturer, and which costing method you use, change the numbers. Damaged or missing stock, write-downs and tax rules also matter. Ask an accountant how your books and taxes treat inventory.
For related views use the inventory turnover calculator, the profit margin calculator and the GMROI calculator. Roll results into a statement with the profit and loss statement generator.
Assumptions and limits
- All amounts are at cost, not at selling price, for the same period.
- Ending inventory cannot exceed the goods available for sale.
- Freight in and returns are optional and default to zero.
- The tool does not choose a costing method or handle write-downs.
Frequently asked questions
How do you calculate cost of goods sold?
Add beginning inventory and purchases, subtract ending inventory. With $10,000 to start, $40,000 of purchases and $12,000 left, COGS is $38,000.
Is freight included in COGS?
Freight you pay to bring inventory in is usually part of inventory cost, which is why the tool has a freight in box. Whether it applies to you depends on your accounting method.
What is the difference between COGS and operating expenses?
COGS is the direct cost of the products sold. Operating expenses are other costs of running the business, such as rent and marketing.
Why can ending inventory not be higher than goods available?
You cannot have more inventory at the end than you started with plus what you bought. If the count is higher, a number was entered in error.