Skip to content
Businesspricing

Gross Margin Calculator

Gross margin after direct costs only. The line that matters is what counts as COGS: put overhead in it and you are computing operating margin under a different name.

Also called: gross profit calculator, gross margin percentage.

$
$
Gross margin
60%

60% gross margin. $60,000.00 of gross profit on $100,000 of revenue.

Gross profit
$60,000.00
Method and background

How this is calculated

Revenue minus the cost of goods sold, over revenue. COGS is direct cost. Materials, the labour that touched the product, payment processing. Rent, salaries and marketing sit below the line, which is why gross margin is higher than every margin beneath it.

gross_margin = (revenue - cogs) / revenue * 100
R
Revenue (currency)
COGS
Cost of goods sold: direct costs only (currency)

Worked examples

Each of these is asserted on every build. If a change to the engine ever moved one of these answers, the build would fail before the page could print it.

60% gross margin

Revenue
$100,000.00
Cost of goods sold
$40,000.00

Gross margin60%

arithmetic identity

Open this example

COGS above revenue gives a negative margin

Revenue
$50,000.00
Cost of goods sold
$60,000.00

Gross margin-20%

boundary: selling below cost is a real state, not an error

Open this example

zero revenue

Revenue
$0.00
Cost of goods sold
$100.00

Gross margin0%

degenerate case: guarded division

Open this example

Frequently asked questions

What is the difference between margin and markup?
Margin is the profit as a share of the selling price; markup is the profit as a share of the cost. A 50% markup is a 33.3% margin, and confusing the two is one of the most expensive arithmetic errors in small business pricing.
What counts as cost of goods sold?
The costs that vary directly with each unit sold: materials, direct labour, payment processing, shipping. Rent, salaries and software are operating costs and belong below the gross margin line, not in it.