Gross Margin Calculator
Calculate gross profit, gross margin percentage, and markup from revenue and cost of goods sold. Uses the universal accounting identity used in GAAP, IFRS, and UK FRS 102 reporting.
Gross profit
£40,000.00
- Gross margin
- 40%
- Markup on cost
- 66.67%
- Revenue
- £100,000.00
- Cost of goods sold
- £60,000.00
Gross profit = Revenue − Cost of Goods Sold. Gross margin expresses that profit as a percentage of revenue, showing how much of each dollar of sales is left after the direct cost of producing what you sold. Markup is a sister figure — the same gross profit as a percentage of cost — and it is always higher than gross margin for the same business. Typical gross margins: grocery 20–30%, mass-market retail 30–40%, branded consumer goods 50–60%, software / SaaS 70–85%.
How to use this calculator
Enter revenue (total sales — the top line of the income statement) and cost of goods sold (the direct cost of what you sold: raw materials, direct labour, freight in, and manufacturing overhead). The calculator updates as you type and returns three numbers: gross profit in currency, gross margin as a percentage of revenue, and markup as a percentage of cost. For a single product, use the unit selling price and unit cost; for a business, use the totals over a period (a month, quarter, or year).
How the calculation works
Gross profit is revenue minus cost of goods sold — the cash left after paying for what you sold, before operating expenses, interest, taxes, and depreciation. Gross margin expresses that profit as a fraction of revenue: Gross Margin = (Revenue − COGS) / Revenue × 100. Markup expresses the same gross profit as a fraction of cost: Markup = (Revenue − COGS) / COGS × 100. The two are easy to confuse but always differ — a 50% margin is a 100% markup, a 33% margin is a 50% markup. Margin caps at 100%; markup has no upper bound.
Worked example
A retailer buys widgets for $60 each and sells them for $100. Gross profit per unit = 100 − 60 = $40. Gross margin = 40 / 100 = 40%. Markup on cost = 40 / 60 = 66.67%. Across 1,000 units sold in a month: revenue $100,000, COGS $60,000, gross profit $40,000, margin still 40%.
Frequently asked questions
What is the difference between gross margin and markup?
Both measure the same gross profit, but as a percentage of different bases. Gross margin is gross profit divided by revenue (selling price); markup is gross profit divided by COGS (cost). A widget that costs $60 and sells for $100 has a 40% gross margin (40 / 100) and a 66.67% markup (40 / 60). Margin is what investors and analysts use to compare companies; markup is what retailers use to set prices off a cost catalogue. The relationship: markup = margin / (1 − margin); margin = markup / (1 + markup).
What counts as cost of goods sold (COGS)?
COGS is the direct cost of producing what you sold during the period: raw materials, direct labour, freight in, and manufacturing overhead (factory rent, machine depreciation, production utilities). It excludes selling, general and administrative expenses (SG&A), marketing, R&D, interest, and taxes — those sit below the gross profit line. For service businesses, the analogous figure is "cost of revenue" or "cost of services" — direct staff time and any third-party costs billed through to the client.
What is a good gross margin?
It is entirely industry-dependent. Typical bands: grocery and food retail 20–30%, mass-market apparel and general retail 30–45%, branded consumer goods 50–65%, restaurants 60–70% on food, industrial manufacturing 25–35%, pharmaceuticals 70–85%, software and SaaS 70–90%, professional services 30–50%. Compare a company against sector peers, not a universal benchmark. A persistent decline in gross margin year over year is usually a more important signal than the absolute level.
How is gross margin different from net margin and operating margin?
Three nested layers of profitability. Gross margin = (Revenue − COGS) / Revenue — strips out only the direct cost of sales. Operating margin = (Revenue − COGS − SG&A − R&D − D&A) / Revenue — strips out all operating expenses, before interest and tax. Net margin = Net Income / Revenue — strips out everything including interest, taxes, and non-recurring items. Gross margin reflects the unit economics of the product; operating margin reflects how well the business is run; net margin reflects the after-everything residual return to shareholders.
Can gross margin be negative?
Yes — if a company sells for less than its direct cost of producing the goods. This is common in startups burning cash to acquire customers, distressed retailers liquidating inventory below cost, or commodity producers caught in a price collapse. A persistently negative gross margin means the core unit economics do not work — no amount of operating discipline downstream can fix it. The first job of any pricing review is to make sure gross margin is positive at the unit level.
How do I work backwards from a desired margin to a selling price?
If you want margin m (as a decimal) at cost C, the selling price is P = C / (1 − m). For a 40% margin on a $60 cost: P = 60 / (1 − 0.40) = 60 / 0.60 = $100. Do not simply multiply cost by (1 + m) — that gives a markup, not a margin, and undershoots the price you need. The single most common pricing error in small business is using 1.40 × cost when 40% margin was intended; the correct multiplier is 1 / 0.60 ≈ 1.667.