
If you sell products, cost of goods sold is the number that tells you what those products really cost you. It sits between your revenue and your gross profit, so getting it wrong distorts almost everything else: your margins, your prices and, eventually, your tax. The idea is simple, but the details matter.
What COGS is
Cost of goods sold is the direct cost of the products you sold during a period. For a retailer, that is mainly what you paid for the goods. For a manufacturer, it also includes the materials and labour used to make them. It counts only the stock that was sold, not the stock still on your shelves.
The formula
COGS = beginning inventory + purchases โ ending inventory. Suppose you start the year with 20,000 of stock, buy another 60,000 during the year, and finish with 25,000 left. COGS is 20,000 + 60,000 โ 25,000 = 55,000. In effect, you had 80,000 of goods available and 25,000 remained, so 55,000 was sold.
From COGS to gross profit
Subtract COGS from revenue to get gross profit. If those goods brought in 90,000, gross profit is 35,000, and gross margin is 35,000 รท 90,000, or 38.9%. That margin is what is left to cover rent, wages, marketing and everything else. For the link between margin and pricing, see our guide on markup vs margin.
What goes into COGS
The purchase price is the starting point. Add the other costs of getting the goods to a saleable state: freight in, import duties and non-refundable purchase taxes where applicable, and packaging that goes with the product. For manufacturers, direct materials and direct labour count too. Supplier discounts and returns reduce the cost.
What does not
Costs that are not tied to the products themselves are operating expenses: marketing, office rent, administration wages, software, and usually the cost of shipping to customers. Keeping them out of COGS keeps your gross margin meaningful.
How the costing method changes the answer
When prices change, which cost you assign to the goods sold matters. Say you buy 100 units at 10 and later another 100 at 12, and then sell 120. Under first-in, first-out you assume the oldest units sold first, so COGS is 100 ร 10 + 20 ร 12 = 1,240. Under a weighted average, the average cost is 11, so COGS is 120 ร 11 = 1,320. The difference of 80 is just timing, but it changes profit for the period. A third method, last-in, first-out, is permitted in some countries but not under international standards, so check what your accountant advises. Choose one method and keep using it. Our moving average cost calculator shows how the average moves with each purchase.
Count your stock properly
The formula leans on an accurate ending inventory, so a miscount feeds straight into profit. Count regularly, value stock at cost rather than selling price, and write down items that are damaged or obsolete. A careless count can swing your results as much as a pricing mistake.
Service businesses
Pure service businesses usually do not report COGS because they do not sell stock. Some report a cost of services, such as direct labour on client work, which plays a similar role. If you sell both products and services, keep the two apart.
Common mistakes
Including overheads in COGS, leaving out freight and duties, mixing up periods, valuing stock at retail price, and changing costing methods without a reason are the usual culprits. A negative or very odd COGS is almost always a data error, so check your counts and purchase records first.
An example for a small online shop
An online shop buys 300 units at 6.00 each, which is 1,800. Freight in costs 150 and import duty at 4% adds 72. The landed cost is 1,800 + 150 + 72 = 2,022, or 6.74 per unit. That 6.74, not the 6.00 on the supplier's invoice, is the figure that should drive pricing. A shop pricing from 6.00 would believe it earns more on every sale than it actually does.
Returns, damage and shrinkage
Goods that come back, break or go missing affect COGS. Items returned in saleable condition go back into inventory at cost. Damaged or lost items are written off, and the cost is usually recorded as part of cost of goods sold or as a separate loss, depending on your accounting policy. Either way, count and record them. Ignoring shrinkage makes your stock look healthier than it is and your margin look better than it is.
Use it every period
Calculate COGS at every period end, not only at the year end, so you can spot margin problems early. Try our COGS calculator with your own figures, and see inventory turnover for how COGS feeds into stock efficiency. This guide is general information, not accounting advice.


