Cost of goods sold (COGS) is the cost of the products you actually sold in a period. It is not the same as what you bought, because some of what you purchased is still on the shelf, and some of what you sold came from stock bought earlier. This calculator derives COGS from your opening and closing inventory and purchases, then shows the gross profit, the margin and how quickly stock turns over.
How the calculation works
- COGS = opening inventory + purchases + freight-in − closing inventory
- Gross profit = sales − COGS
- Gross margin = gross profit ÷ sales
- Markup on cost = gross profit ÷ COGS
- Inventory turnover = COGS ÷ average inventory, where average inventory = (opening + closing) ÷ 2
- Days of inventory = 365 ÷ turnover (when the period is one year)
Example
A retailer starts the year with $42,000 in inventory, buys $118,000 of goods, pays $3,500 in freight-in and ends the year with $38,000 in stock. COGS = 42,000 + 118,000 + 3,500 − 38,000 = $125,500. With sales of $240,000, gross profit is $114,500, the gross margin is 47.7 %, and the markup on cost is 91.2 %. Average inventory is $40,000, so stock turns 3.14 times a year, or about 116 days of inventory.
Why it matters
COGS is the first thing subtracted from sales in an income statement, and the quality of every later figure depends on it. A retailer who does not track closing inventory cannot know whether a good month was due to strong margins or to under-buying. Tracking COGS also shows quickly if supplier prices, freight or shrinkage are cutting into profit.
Good to know
Accounting rules allow different ways of valuing inventory (FIFO, LIFO where allowed, or weighted average), and in times of rising prices they give different COGS and profit. Losses from theft, damage and spoilage (shrinkage) are in COGS unless recorded separately. For a business with high-volume sales, the turnover for the period is not annual: multiply a quarterly turnover by four to compare with a year. This tool is for education and is not accounting advice.
Related tools
The GMROI calculator relates gross margin to inventory investment, the inventory turnover calculator focuses on how fast stock moves, and the margin calculator converts margin and markup.