🧮
Inventory & operations

Cost of Goods Sold Explained

6 min read · All guides
Cost of Goods Sold Explained

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.

Key takeaways

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.

How to do it with GoInvoicePrint

You can do this in a couple of minutes with our free COGS Calculator. No download is needed and it works on your phone too.

COGS Calculator with beginning inventory 20,000, purchases 60,000 and ending inventory 25,000, giving COGS of 55,000
COGS Calculator with beginning inventory 20,000, purchases 60,000 and ending inventory 25,000, giving COGS of 55,000
  1. Open the free COGS Calculator.
  2. Enter the value of your stock at the start of the period (beginning inventory).
  3. Enter everything you bought for resale during the period, including inbound shipping, then the value of stock left at the end.
  4. Read your COGS – in the example 20,000 + 60,000 − 25,000 = 55,000 – and subtract it from revenue to find gross profit.

Frequently asked questions

Is shipping included in cost of goods sold?

Shipping you pay to bring stock in from suppliers is usually part of COGS. Shipping you pay to send orders to customers is often recorded as a selling expense instead, though some businesses include it. Be consistent and follow your accountant’s advice.

Do service businesses have COGS?

Many use a similar line called cost of services or cost of revenue, which includes direct labour and materials used to deliver the service.

Is COGS an expense?

Yes. It appears on the income statement as the first cost after revenue, and it is deducted before operating expenses.

What if ending inventory is higher than beginning inventory?

That simply means you bought more than you sold during the period. COGS will be lower than purchases, and the extra stock appears on the balance sheet as an asset.

Put this into practice with our free tool.Try the COGS calculator →

More guides

🔄Reorder Point and Safety Stock Explained
6 min readReorder Point and Safety Stock ExplainedHow to work out when to reorder, how much safety stock to hold, and how EOQ decides the order size.Read guide →
🔁Inventory Turnover: What It Is and How to Improve It
6 min readInventory Turnover: What It Is and How to Improve ItHow to calculate inventory turnover, what a good number looks like and practical ways to release cash tied up in stock.Read guide →
🏷️SKU System Guide: How to Name and Number Your Products
6 min readSKU System Guide: How to Name and Number Your ProductsHow to build a clear, consistent SKU structure, handle variants and avoid common spreadsheet and numbering mistakes.Read guide →