Skip to content

Cost of Goods Sold Calculator

Opening stock, what you bought, what went back, what it cost to get it in, and what was left at the end. The calculator prints the statement in the order an accountant writes it, works out your gross profit, and shows every line of the arithmetic.

  • Free
  • No account needed
  • Nothing leaves your browser
£

Stock you were holding on day one — last period's closing figure.

£

Everything bought for resale in the period, at invoice value.

£

Stock still on the shelf at the end. It is taken back off — you have not sold it.

£

Sales after refunds and allowances. Needed for the gross profit line — leave it at zero for the cost figure alone.

Refine
£
£
£

Returns and discounts come off the purchases. Carriage inwards — freight and duty paid to get stock in — is added. Carriage outwards, what you pay to send goods to a customer, is a selling expense and does not belong here.

Loaded with an example. Type over any field.

Cost of goods sold

£46,480.00

Sales of £79,500.00 on £46,480.00 of stock leave £33,020.00 gross profit — 41.5% of sales

Net purchases
£46,530.00
Goods available for sale
£61,080.00
Net sales
£79,500.00
Gross profit
£33,020.00 · 41.5%

The working

  1. Net purchases: £48,750.00 − £1,280.00 − £940.00 = £46,530.00
  2. Goods available for sale: £12,400.00 + £46,530.00 + £2,150.00 = £61,080.00
  3. Cost of goods sold: £61,080.00 − £14,600.00 = £46,480.00
  4. Gross profit: £79,500.00 − £46,480.00 = £33,020.00
  5. Gross profit margin: £33,020.00 ÷ £79,500.00 = 41.5%

Gross profit only. Rent, wages, marketing and delivery to the customer all come off below this line. The margin calculator does the same arithmetic one item at a time.

The same money, three ways

Every bar below is drawn to the same scale, so you can compare their lengths directly. The dark block is the cost of goods sold — watch it appear twice, once as the part of your stock that sold and once as the part of your sales that was cost.

Where the stock came from

£61,080.00

Everything you had available to sell this period.

  • Opening inventory£12,400.00
  • Net purchases£46,530.00
  • Carriage in£2,150.00

Where that stock went

£61,080.00

The same total, split between what sold and what did not.

  • Sold — cost of goods sold£46,480.00
  • Still on the shelf£14,600.00

What you sold it for

£79,500.00

The same cost block, now sitting inside your sales.

  • Cost of goods sold£46,480.00
  • Gross profit£33,020.00

Of every £1.00 that came in, £0.58 went on the goods themselves and £0.42 was gross profit — before rent, wages or anything else.

The formulas, at a glance

Six lines. Each one feeds the next, which is why the order matters more than any single step.

Net purchases
NP = P − PR − PD
Cost of goods available for sale
COGAS = OI + NP + DE
Cost of goods sold
COGS = COGAS − CI
Cost of goods sold, in full
COGS = OI + P − PR − PD + DE − CI
Gross profit
GP = Net sales − COGS
Gross profit margin
GP % = GP ÷ Net sales × 100

OI opening inventory · P purchases · PR purchase returns · PD purchase discounts · NP net purchases · DE direct expenses · COGAS cost of goods available for sale · CI closing inventory · COGS cost of goods sold

Check this before you rely on it. A free everyday calculator, provided as a guide — not tax, accounting, financial or legal advice. The working is shown above so you can verify it against your own figures. See our terms of use.

How it works

STEP 1

Start with the stock you had

Opening inventory is what you were holding on day one — last period’s closing figure. Then add everything you bought for resale during the period, at invoice value.

STEP 2

Take off returns, add carriage in

Goods sent back and discounts received come off the purchases to give net purchases. Freight and duty paid to get stock into your hands are added. Both are under Refine.

STEP 3

Subtract what is left on the shelf

Closing inventory has not been sold, so it comes back out of the goods available for sale. What remains is the cost of goods sold, and your sales less that figure is gross profit.

What this doesn't cover

Knowing where a calculator stops is what makes the rest of it trustworthy.

  • Overheads and operating costsRent, wages, software, marketing and your own time are not in this statement. Cost of goods sold is direct cost only, which is why the answer is gross profit rather than net profit.
  • Carriage outwardsWhat you pay to deliver goods to a customer is a selling expense and sits below the gross profit line. Only carriage inwards — the cost of getting stock in — belongs here.
  • Stock valuation methodThe figures are taken as you enter them. FIFO, weighted average and net realisable value can each give a different closing inventory, and that choice moves the answer without any of this arithmetic changing.
  • VATEverything is treated as VAT-exclusive. If your purchase or sales figures include VAT, take it off first with the VAT calculator, or the cost and the margin will both read wrong.
  • Shrinkage, write-offs and manufacturingStolen, damaged or obsolete stock is assumed to be already out of the closing figure. A manufacturer’s cost of goods sold also folds in direct labour and factory overheads, which this statement does not model.

Common questions

What is the formula for cost of goods sold?

COGS = opening inventory + purchases − purchase returns − purchase discounts + direct expenses − closing inventory. The short version most people learn is COGS = opening stock + net purchases − closing stock, where net purchases is purchases after returns and discounts, and direct expenses means carriage inwards, freight and import duty.

Is closing inventory added or subtracted?

Subtracted. It is the stock you still have, so by definition it has not been sold and its cost has not been incurred yet. Adding it instead of subtracting it is the single most common error in the statement, and it moves the answer by twice the value of the stock — enough to turn a profitable year into a loss on paper.

What are net purchases?

Purchases after everything that reduces them: goods returned to the supplier, and settlement or trade discounts received. NP = P − PR − PD. Using gross purchases instead overstates your cost and understates your profit, and because both figures still look plausible the mistake usually survives until someone reconciles the supplier statements.

What counts as a direct expense?

Anything you pay to get stock into a saleable position: carriage inwards, freight, import duty, insurance in transit. The test is direction. Costs of bringing goods in are part of what the goods cost you; costs of sending goods out to a customer are a selling expense and belong below the gross profit line.

What is the difference between COGS and cost of sales?

For most retail and wholesale businesses, nothing — the two names describe the same figure and are used interchangeably. The distinction people sometimes draw is that cost of sales can also carry direct labour and other costs of delivering a service, which is why a service business will often use that name while a shop uses cost of goods sold.

How do I work out gross profit from COGS?

Gross profit = net sales − cost of goods sold, and gross profit margin is that figure divided by net sales, not by cost. On sales of 79,500 with a cost of goods sold of 46,480, gross profit is 33,020 and the margin is 33,020 ÷ 79,500 = 41.5%. Dividing by the cost instead gives 71.0%, which is the markup — a different number answering a different question.

Does cost of goods sold include VAT?

No, not if you are VAT registered. You reclaim the VAT on your purchases, so it is never a cost to you and it does not belong in the statement. Enter every figure net of VAT. A business that is not VAT registered cannot reclaim it, so for them the VAT-inclusive price genuinely is the cost.

Why is my closing inventory larger than the goods available for sale?

It cannot be, and the calculator refuses that combination rather than printing a negative cost. You cannot end a period holding more stock than you started with plus everything you bought. In practice it means a purchase invoice is missing, the opening figure is from the wrong date, or the stocktake has been valued at selling price rather than cost.

What period should I use?

Whatever period you are reporting on — a month, a quarter or a full financial year — as long as every figure comes from the same one. The opening inventory must be the closing inventory of the period immediately before, and the sales figure must cover exactly the same dates. Mixing a year of purchases with a month of sales is the quiet way to produce a margin that looks impossible.