A COGS calculator works out the cost of goods sold for a period from your inventory figures: the stock you started with, plus what you bought, minus the stock left at the end. Enter the three amounts at cost and the calculator shows the cost of goods sold and the cost of goods that were available for sale. Add your net sales to see gross profit and gross margin too.
The COGS formula
Cost of goods available = beginning inventory + purchases
COGS = beginning inventory + purchases − ending inventory
Gross profit = net sales − COGS
The IRS explains that cost of goods sold is beginning inventory plus purchases and other costs, minus inventory at the end of the year. Gross profit is net sales minus cost of goods sold. In other words, whatever was available to sell and is no longer in stock is treated as sold.
What goes into COGS
The IRS says costs include freight-in on goods bought for sale. For a shop, that means the price paid for products including freight or shipping in. For a maker, it includes raw materials and parts, direct labour with its payroll taxes and benefits, and a share of factory overhead. Trade discounts, returns and allowances reduce the cost of purchases. Selling and administrative costs are not part of cost of goods sold, and packing and shipping to customers are usually treated as selling expenses.
How to use the COGS calculator
- Enter beginning inventory, the cost of stock on hand at the start of the period. It is the ending inventory from the previous period.
- Enter purchases for the period at cost, including freight in, less returns and discounts.
- Enter ending inventory, from a stock count or your inventory system, at cost.
- Optionally enter net sales to see gross profit and margin.
- Press Calculate.
Worked example
A shop starts the quarter with stock that cost $20,000, buys $50,000 more and counts $15,000 of stock at the end. Goods available for sale cost $70,000, so the cost of goods sold is $20,000 + $50,000 − $15,000 = $55,000. If the shop's net sales for the quarter were $90,000, its gross profit is $35,000 and its gross margin is 38.9 percent.
How inventory valuation changes COGS
When prices change, the method used to value inventory changes the cost of goods sold. A textbook example shows the same stock costed three ways: first in, first out leaves $7,200 in cost of goods sold, weighted average $8,283 and last in, first out $9,360. A trader who buys two machines at 10 each and then two more at 12 each, and sells two, would see 20, 22 and 24 respectively. The ending inventory figure moves in the opposite direction, so the total of COGS and ending inventory stays the same. Whatever method you use, apply it consistently from period to period so the figures can be compared.
Why ending inventory matters so much
Because ending inventory is subtracted, any error in it flows straight into cost of goods sold and gross profit. Overstating ending stock by $1,000 makes COGS $1,000 too low and profit $1,000 too high, and the mistake reverses in the next period because this period's ending inventory becomes next period's beginning inventory. A careful stock count at the end of each period, valued at cost, is the single most important step in getting COGS right.
COGS and the income statement
Cost of goods sold sits just below sales on the income statement, and the difference is gross profit. Running costs such as rent, wages for sales staff and marketing come next and are subtracted to reach operating profit. Watching gross margin over time shows whether buying costs are rising faster than prices. For pricing from a cost, try the markup calculator, and for margin on individual products, the gross margin calculator.
Quick reference
| Beginning | Purchases | Ending | COGS |
|---|---|---|---|
| $20,000 | $50,000 | $15,000 | $55,000 |
| $8,000 | $12,000 | $9,000 | $11,000 |
| $0 | $30,000 | $6,000 | $24,000 |
| $45,000 | $0 | $40,000 | $5,000 |
Service businesses
A business that sells services rather than goods may have no inventory at all. Some service businesses report a cost of sales or cost of revenue instead, made up of the direct costs of delivering the service, such as contractor fees. The inventory formula here does not apply in that case; simply add up those direct costs for the period.
Checking the result
A quick sanity check is to compare cost of goods sold with sales. If COGS is larger than sales, the business sold its goods for less than they cost, which can happen during a clearance but should not be normal. A sudden jump in COGS without a matching rise in sales often points to a counting error, theft or damaged stock that was written off.
Common mistakes
- Valuing stock at selling price. Inventory is valued at cost.
- Including selling and delivery costs. Those are operating expenses.
- Forgetting freight in and discounts. Add shipping on purchases; subtract trade discounts and rebates.
- Mismatched periods. Purchases and both stock counts must match the same dates.
A second COGS example: stock that grew
A small shop starts the month with stock that cost $12,000, buys $30,000 more and counts $18,000 of stock at the end. Enter 12,000, 30,000 and 18,000, and add net sales of 40,000. The calculator shows:
- Cost of goods available for sale: $12,000 + $30,000 = $42,000
- Cost of goods sold: $42,000 − $18,000 = $24,000
- Gross profit: $40,000 − $24,000 = $16,000, a gross margin of 40 percent
Here COGS is lower than the purchases, because the shop bought more than it sold and the extra $6,000 went onto its shelves. That is normal before a busy season. If ending inventory is ever larger than beginning stock plus purchases, the calculator shows an error instead of a result, because the figures can’t all be right.
What next
Use this often? Add COGS to your Home screen.
Frequently asked questions
How does a COGS calculator work?
It adds purchases to beginning inventory and subtracts ending inventory. $20,000 + $50,000 − $15,000 gives a COGS of $55,000.
What is included in cost of goods sold?
Costs of purchase and conversion, such as products bought, freight in, raw materials, direct labour and factory overhead. Selling and delivery costs are not included.
How do you find gross profit from COGS?
Subtract COGS from net sales. $90,000 − $55,000 is $35,000 of gross profit.
Does the inventory method change COGS?
Yes. When prices change, FIFO, average cost and LIFO give different COGS for the same goods.
Where does beginning inventory come from?
It is the ending inventory of the previous period.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.