Cost of Goods Sold: Formula, Calculation and UK Examples
Cost of goods sold is opening stock plus purchases minus closing stock. What to include, how to calculate it for a wholesaler or manufacturer, and UK examples.
Cost of goods sold is the direct cost of the goods a business sold during a period. The cost of goods sold formula is opening stock + purchases − closing stock. In UK accounts the same figure is usually called cost of sales, and COGS is the common abbreviation.
The cost of goods sold formula
The cost of goods sold equation works because everything you started with, plus everything you bought, has either been sold or is still on the shelf. Stock that was lost, stolen or scrapped is not on the shelf, so it falls into cost of goods sold as well.
- Opening stock is the value of stock at the start of the period. It is last period’s closing stock.
- Purchases are the goods or materials bought in the period, after returns and trade discounts, plus the costs of getting them in. How that buying is organised is covered in what is procurement.
- Closing stock is the value of what is left, from a stocktake or your stock records. HMRC accepts the lower of cost and net realisable value as a basis for valuing it.
Hypothetical one-line example: £42,000 + £310,000 − £47,000 = £305,000.
What is included in cost of goods sold
What is cost of goods sold made up of? The cost of the stock you sold. FRS 102, the UK financial reporting standard published by the Financial Reporting Council, says in Section 13 that the cost of stock includes all costs of purchase, costs of conversion and other costs of bringing it to its present location and condition.
| Cost | In cost of goods sold? | Notes |
|---|---|---|
| Purchase price of goods or materials | Yes | After trade discounts and rebates |
| Freight in (carriage inwards) and handling | Yes | Part of getting stock to your premises |
| Import duty | Yes | VAT you can reclaim is not a cost |
| Direct labour (manufacturers) | Yes | Wages of the people making the product |
| Production overheads (manufacturers) | Yes | A fair share of factory rent, power and machine depreciation |
| Selling and marketing costs | No | An operating expense |
| Administration: office salaries, accountancy, software | No | An operating expense |
| Delivery out to customers (carriage outwards) | Usually no | A distribution cost. Some management accounts put it in cost of sales, so be consistent |
| Storing finished goods | No | Unless storage is a necessary stage of production |
FRS 102 names selling costs, administrative overheads that do not help bring stock to its present location and condition, and most storage costs as costs to leave out of stock and expense as they arise. Micro-entities and sole traders may follow different rules, which is one reason to check with an accountant.
Cost of goods sold vs cost of sales vs operating expenses
| Term | Meaning | Examples |
|---|---|---|
| Cost of goods sold (COGS) | The direct cost of the goods sold in the period | Stock purchases, freight in, duty |
| Cost of sales | The usual UK name for the same line. In a service or project business it is wider and includes direct labour and subcontractors | As above, plus labour on jobs |
| Operating expenses (overheads) | Costs of running the business that are not tied to each sale | Rent, office wages, marketing, insurance, delivery out |
One of the statutory profit and loss formats for UK companies lists turnover, then cost of sales, then gross profit or loss, with distribution costs and administrative expenses below.
How to calculate cost of goods sold for a wholesaler or retailer
Hypothetical: a homeware wholesaler in Nottingham, for the year to 31 March.
- Take opening stock from last year’s closing figure: £42,000.
- Add up purchases of goods for resale, excluding VAT you can reclaim and after returns and discounts: £298,500.
- Add the cost of getting the goods in, here freight in and import duty: £11,500. Total purchases are £310,000.
- Count and value closing stock: £47,000.
- Apply the formula: £42,000 + £310,000 − £47,000 = £305,000.
If you are asking “how do I calculate cost of goods sold for one month?”, the steps are the same. Use the month’s opening and closing stock from your stock records instead of a full count.
Cost of goods sold calculation for a manufacturer
A manufacturer holds three kinds of stock: raw materials, work in progress and finished goods. The same formula is applied to each in turn. FRS 102 says the costs of conversion include direct labour and a systematic share of production overheads.
Hypothetical: a furniture maker in Stoke-on-Trent, for one year.
| Line | Calculation | Amount |
|---|---|---|
| Raw materials used | £18,000 opening + £240,000 purchases − £22,000 closing | £236,000 |
| Direct labour | Wages of production staff | £150,000 |
| Production overheads | Factory rent, power, machine depreciation | £84,000 |
| Total production cost | Sum of the three lines above | £470,000 |
| Change in work in progress | £9,000 opening − £12,000 closing | −£3,000 |
| Cost of goods manufactured | £467,000 | |
| Change in finished goods | £31,000 opening − £36,000 closing | −£5,000 |
| Cost of goods sold | £462,000 |
On sales of £700,000 that leaves a gross profit of £238,000, a gross margin of 34.0%. A workshop that makes to order builds the same figure job by job. See what is job costing.
How the stock valuation method changes the answer
When purchase prices change, you need a rule for which costs go into cost of goods sold and which stay in stock. For interchangeable items, FRS 102 allows first in, first out (FIFO) or weighted average cost. Here are both on the same hypothetical purchases of one product.
| Units | Unit cost | Value | |
|---|---|---|---|
| Opening stock | 100 | £10.00 | £1,000 |
| Purchase, February | 200 | £11.00 | £2,200 |
| Purchase, March | 200 | £12.50 | £2,500 |
| Available for sale | 500 | £5,700 |
The business sells 350 units at £18.00 each and has 150 left. The weighted average cost is £5,700 ÷ 500 = £11.40 a unit.
| FIFO | Weighted average cost | |
|---|---|---|
| Cost of goods sold | 100 × £10.00 + 200 × £11.00 + 50 × £12.50 = £3,825 | 350 × £11.40 = £3,990 |
| Closing stock | 150 × £12.50 = £1,875 | 150 × £11.40 = £1,710 |
| Sales | £6,300 | £6,300 |
| Gross profit | £2,475 | £2,310 |
| Gross margin | 39.3% | 36.7% |
The goods and the sales are identical, yet cost of goods sold differs by £165. When prices are rising, FIFO gives the lower cost of goods sold and the higher profit. FRS 102 requires the same method for all stock of a similar nature, so pick one and keep it. The table uses a single average for the period. Software that recalculates the average after every purchase can give a slightly different figure.
Last in, first out (LIFO) is not an option in the UK. FRS 102 does not permit it, and HMRC’s Business Income Manual says LIFO is not allowable for valuing stock for tax purposes.
FIFO as a costing method is separate from physically using the oldest stock first, which is covered in the FIFO system in stores.
Where it sits in the profit and loss account
Cost of goods sold is the first deduction from sales. What is left is gross profit.
| Line (hypothetical wholesaler) | Amount |
|---|---|
| Sales | £436,000 |
| Cost of sales (cost of goods sold) | £305,000 |
| Gross profit | £131,000 |
| Gross margin | 30.0% |
| Operating expenses | £96,000 |
| Operating profit | £35,000 |
- Gross profit = sales − cost of goods sold: £436,000 − £305,000 = £131,000.
- Gross margin = gross profit ÷ sales × 100: £131,000 ÷ £436,000 × 100 = 30.0%.
Gross margin is the figure prices are set against. See margin vs markup. Cost of goods sold also drives stock turn: £305,000 ÷ average stock of £44,500 = 6.9 times a year. See inventory turnover ratio.
How stocktake errors and landed cost change it
Stocktake errors. Closing stock is subtracted in the formula, so every pound of error in the count is a pound of error in profit. If the hypothetical wholesaler counts £52,000 when the true figure is £47,000, cost of goods sold drops to £300,000, gross profit rises to £136,000 and gross margin shows 31.2% instead of 30.0%. The £5,000 is not real. This year’s closing stock is next year’s opening stock, so next year’s cost of goods sold comes out £5,000 too high. A sound physical stocktaking procedure and an accurate stock record are what make the figure reliable.
Landed cost. If the £11,500 of freight and duty is posted to overheads instead of to the goods, purchases show as £298,500. Ignoring the smaller effect on the stock valuation, cost of goods sold shows as £293,500 and gross margin as 32.7%. Net profit is unchanged, but prices set against a 32.7% margin are set against the wrong cost. Our guide to landed cost calculation shows how to cost each unit.
Common mistakes
- Treating purchases as cost of goods sold. The wholesaler bought £310,000, but stock rose by £5,000, so only £305,000 was sold.
- Leaving freight in and duty in overheads.
- Putting delivery out, marketing or office wages into cost of goods sold.
- Including VAT that you reclaim.
- Valuing closing stock at selling price instead of cost.
- Not writing down damaged or obsolete stock to what it can be sold for.
- Switching valuation method from one period to the next.
- Estimating closing stock without a count or a trustworthy stock record.
Where to find cost of goods sold in Xero, QuickBooks and Sage
The name on screen differs by product. These details are from each vendor’s help pages, checked in November 2026.
- Xero. Tracked inventory uses an inventory asset account and a Cost of Goods Sold account. When a tracked item is sold, Xero moves its cost from one to the other at the item’s average cost at the time of sale, according to Xero’s guide to tracked inventory.
- QuickBooks Online. The account type is Cost of sales, with detail types such as “Supplies and materials - COS” and “Cost of labour - COS”, as listed in QuickBooks’ guide to detail types. For tracked stock it applies FIFO unless you choose its moving average cost option before creating stock items, and the choice cannot be changed later, according to QuickBooks’ FIFO article.
- Sage Accounting. Ledger accounts in the Direct expenses category, with default nominal codes 5000 to 5999, hold costs directly related to the things you sell, according to Sage’s guide to ledger account fields.
How do you find cost of goods sold if the software does not track stock? Purchases are then posted to cost of sales as they are bought, and the figure is only right once a stock adjustment has been entered at the period end. That is normally a job for your accountant.
How to get the figure right every month
- Agree with your accountant what goes into the cost of stock for your business.
- Record freight and duty against the goods they relate to.
- Keep stock records current, so opening and closing stock are available without a full count.
- Count stock at the year end at least, and cycle count fast-moving lines in between.
- Choose FIFO or weighted average cost and stay with it.
- Write down damaged and obsolete stock when you find it.
- Compare gross margin month by month. A sudden jump is more often a stock or posting error than a change in trade.
FAQs
What is cost of goods sold?
Cost of goods sold is the direct cost of the goods a business sold in a period: what it paid for them plus the cost of getting them in and, for a manufacturer, the cost of making them. UK accounts usually call it cost of sales.
How do I calculate cost of goods sold?
Add purchases to opening stock and subtract closing stock. With £42,000 of opening stock, £310,000 of purchases and £47,000 of closing stock, cost of goods sold is £305,000.
How do you find cost of goods sold?
Look for the cost of sales line directly under sales on the profit and loss report. If your software does not track stock, the line shows purchases until a closing stock adjustment is made.
How do you determine cost of goods sold?
Decide which costs belong in stock, value opening and closing stock using FIFO or weighted average cost, then apply the formula. What you include and the valuation method both change the answer.
Is cost of goods sold the same as cost of sales?
For a business that buys and sells goods, yes. Cost of sales is the usual UK name. In a service or project business, cost of sales is wider and includes direct labour and subcontractors.
Can a sole trader claim cost of goods sold as an expense?
The government’s guidance on expenses if you are self-employed lists goods for resale, raw materials and direct costs from producing goods as allowable business expenses. Ask an accountant how stock should be treated in your accounts.
How OpsMavix can help
Cost of goods sold is only as good as three things: what you record as the cost of each item, the stock quantities, and the count. Accounting software handles the ledger side. The harder part is keeping costs and quantities right day to day.
OpsMavix builds custom stock systems that can be scoped to hold a landed cost for each item, record receipts and counts, and feed stock values to your accounts. What goes into the cost is agreed with you and your accountant for each project. First systems start from £4,950 at a fixed price in writing and go live in about 30 days. You pay half to start and half when it works, there are no per-seat fees, and you own the code, data and hosting. See inventory automation and manufacturing production tracking. A fabrication workshop system has been in use by a paying client since September 2026.
OpsMavix ERP is the off-the-shelf option. It covers stock with bins, counts, labels and barcodes, orders, purchasing and the books for £99.99 a month for the whole company. Its posting rules have not been reviewed by an accountant, so an accountant should check the set-up before you rely on its figures. It is new and has no customer stories. It has one stock location, no variants, no serial or batch tracking, no bank feeds, no HMRC VAT filing, no multi-currency and no payroll.
Who should not use it: an importer buying in dollars or euros, a business with more than one warehouse, or a manufacturer that needs batch tracking. If Xero, QuickBooks or Sage and a disciplined stocktake already give you a gross margin you trust, you do not need us. Otherwise, read is OpsMavix right for you or contact us.
Getting value from OpsMavix? Add us as a preferred source on Google — you'll see more of our operations content in your AI Overviews, AI Mode and Search.