Cost of Goods Sold (COGS) Calculator
Cost of goods sold from your opening stock, purchases and closing stock, with gross profit and margin if you add revenue.
- Free, no sign-up
- Runs in your browser, nothing is stored
- Formula and worked example included
Cost of Goods Sold Calculator
Enter your figures to see results.
What is cost of goods sold, in plain terms?
Cost of goods sold is the direct cost of the products you actually sold in a period: not what you bought, and not what is still in the stockroom. Start with the stock you opened with, add what you bought, take away what was left at the end. Everything else you spent (rent, marketing, admin) is a separate cost.
How to use this calculator
- Enter stock at cost at the start of the period and your purchases during it.
- Enter stock at cost at the end of the period, after any write-downs for damaged or obsolete items.
- Add revenue for the period to see gross profit and gross margin as well.
What your result means
How to read the figure, what counts as normal, and what to do about it.
What cost of goods sold includes
Cost of goods sold is the direct cost of the products you actually sold in a period: not what you bought, and not what you have in the stockroom. The difference matters: a business that bought £160,000 of stock but sold only £154,000 worth has £6,000 more sitting on shelves, and its profit for the period must reflect what was sold, not what was purchased.
For a retailer or wholesaler, COGS is the purchase cost of goods plus getting them to you (carriage inwards, import duty). For a manufacturer, it also includes direct labour and the materials consumed in production. For a service business the equivalent is "cost of sales": subcontractors and direct staff time.
Valuing stock: FIFO or average cost
UK accounting standards (FRS 102) allow stock to be valued on a first-in, first-out basis or at weighted average cost; LIFO is not permitted. When purchase prices are rising, FIFO produces a lower COGS and a higher profit than average cost, because older, cheaper stock is treated as sold first. Whichever you choose, use it consistently and value stock at the lower of cost and net realisable value. Obsolete or damaged stock should be written down, which increases COGS in that period.
Why COGS drives so many other numbers
COGS is the largest expense for most product businesses and sits at the top of the profit and loss account. It determines gross profit and gross margin, feeds the inventory turnover ratio, sets the floor for pricing and discount decisions, and is the figure HMRC compares against purchases when checking that stock has been accounted for. Getting the closing stock count right is therefore worth real effort at the year end.
Worked example: a garden centre's plant sales
The centre started the year with £35,000 of plants and sundries at cost, bought £160,000 more during the year, and counted £41,000 of stock at the year end. Plant sales were £260,000.
COGS = 35,000 + 160,000 − 41,000 = £154,000.
Gross profit = 260,000 − 154,000 = £106,000, a gross margin of 40.8%. Average inventory was £38,000, so stock turned just over four times in the year.
Frequently asked questions
Is COGS the same as purchases?
No. Purchases is what you bought; COGS is what you sold. They only match when stock levels are unchanged over the period.
Are wages part of cost of goods sold?
Only the wages of people directly making or handling the goods sold: production staff, kitchen staff, fitters. Office, sales and management salaries are operating expenses.
How does closing stock affect profit?
Higher closing stock means lower COGS and higher profit for the period, because more of what you bought is still an asset rather than an expense. Overstating closing stock overstates profit and the tax due on it, which is why HMRC pays attention to it.
What about stock that is damaged or unsellable?
Write it down to what it can realistically be sold for (or nil) at the period end. The write-down reduces closing stock and so increases COGS, recognising the loss in the period it happened.
The maths behind this calculator
For anyone who wants to check the working or rebuild it in a spreadsheet.
The formula
COGS = Opening inventory + Purchases − Closing inventory Gross profit = Revenue − COGS Gross margin = Gross profit ÷ Revenue × 100
This is the periodic method most small businesses use: count stock at the start and end of the period and let the formula work out what was consumed in between. Businesses with a perpetual stock system read COGS directly from the system but should still reconcile it to a physical count.
Assumptions and limits
- Opening and closing inventory are valued at cost on the same basis (FIFO or weighted average) and after any write-downs.
- Purchases include direct costs of getting goods ready for sale (carriage inwards, duty). VAT is excluded if the business is VAT-registered.
- Overheads such as rent, marketing and admin salaries are not part of COGS; they come off gross profit to give net profit.
Explore all 30 business tools
Free calculators for pricing, cash, hiring, tax and running costs. Each one shows its working and uses current UK rates where they matter.
Browse the tools hubFinancial Tools6
Cost Management Tools4
- Business energy cost New
- Cost of goods sold
- Overhead allocation
- Price elasticity