Skip to content
SharpTally.

Gross Margin Calculator

Checked

This gross margin calculator works out gross profit and gross margin from revenue and cost of goods sold, in total and per unit. Free, no sign-up, and the result updates as you type.

Enter your numbers

Your numbers

Sales for the period. Exclude sales tax you collected and passed on.

Only the cost of the units you actually sold: product, inbound freight, duty, packaging.

Used for the per-unit figures. Leave at 0 if you only want the percentage.

Your receipt Gross Margin · USD

Gross profit
$7,400.00
COGS as % of revenue
60.0%
Gross profit per unit
$20.00
Revenue per unit
$50.00

Gross margin
40.0%
Gross margin
40.0%

Gross margin has one job: show what share of a sale survives the cost of the goods themselves. The mistake is what gets loaded into COGS. Marketplace fees, ad spend and your Shopify bill are not cost of goods — they belong below the line — but inbound freight, import duty and the box the product ships in are, and leaving them out inflates the margin on every unit you sell. This calculator takes revenue and COGS for a period and returns the margin, the gross profit, the share of revenue your goods consume, and what each unit contributed.

How it's calculated

Gross margin = (revenue − COGS) ÷ revenue × 100 Gross profit per unit = (revenue − COGS) ÷ units sold

LaTeX source \text{Gross margin} = \frac{R - \text{COGS}}{R} \times 100

Worked examples

Example 1

370 units sold for $18,500 with $11,100 of goods

40.0% gross margin

$7,400 of gross profit on $18,500 of sales is a 40% margin, and the goods consumed the other 60%. Per unit that is $50 of revenue against $30 of cost, leaving $20. The $20 is what has to pay for fees, ads, returns and everything else before any of it is profit.

The numbers used
Revenue
18500
Cost of goods sold
11100
Units sold
370
Try these numbers
Example 2

The same $50 product after inbound freight rose $4 a unit

32.0% gross margin

Landed cost went from $30 to $34 a unit while the price stayed at $50, and the margin dropped eight points to 32%. Gross profit per unit is $16 rather than $20 — a fifth of it gone. A freight increase looks trivial on a forwarder invoice and is only visible once it lands in COGS.

The numbers used
Revenue
11750
Cost of goods sold
7990
Units sold
235
Try these numbers

Questions sellers ask

How do I calculate gross margin?

Subtract cost of goods sold from revenue, divide by revenue, multiply by 100. On $18,500 of sales with $11,100 of goods, that is $7,400 ÷ $18,500 = 40%. The denominator is revenue, never cost — dividing by cost gives markup instead, which is always the larger number. Gross margin and the COGS share of revenue always add up to 100, which is the quickest way to check you have not miscalculated.

What is the formula for calculating gross margin?

(Revenue − COGS) ÷ Revenue × 100. The formula is trivial; deciding what counts as COGS is not. Include the product cost, inbound freight, import duty and primary packaging, because those scale with units sold. Exclude marketplace fees, payment processing, advertising, software and salaries — those are operating costs, and folding them in gives you a net margin with a gross margin's name.

What is a 40% gross margin?

A 40% gross margin means 40 cents of every sales dollar is left after the goods are paid for. On a $50 product, the unit costs you $30 and contributes $20. It is a common target in retail because it survives a typical 13% to 15% marketplace fee and still leaves something, but on a slow-moving product that sits in storage for months it may not.

Is 30% a good gross profit margin?

It depends entirely on what has to come out afterwards. A 30% gross margin is healthy for a grocery or hardware business with fast turns and cheap fulfilment, and thin for anyone selling on a marketplace that takes 13.6%, because that fee alone is nearly half the margin. Work out your fee load and ad cost per order first, then judge the 30%.

What does a 20% gross margin mean?

It means the goods cost you 80 cents of every dollar you take. On a $40 sale, $32 is product cost and $8 is gross profit. At that level almost nothing can go wrong: one return, one discount code, or one marketplace fee wipes the unit out. Twenty per cent gross works only at volume with low fixed costs, which is why it is a wholesale and distribution number rather than a retail one.

How to calculate GP%?

GP% is gross profit percentage, the same figure as gross margin: gross profit divided by revenue, times 100. Retail and hospitality teams tend to say GP%, accountants say gross margin, and both mean the money left after cost of sales. Watch for suppliers quoting GP% on the ex-VAT price while you are reading it against the till price — that mismatch is worth several points.

Embed this calculator on your site Free, one line of HTML.
Optional: let the iframe resize itself

Paste this once anywhere on the same page and the iframe grows and shrinks to fit its contents instead of sitting at a fixed 520px.

Free to embed on any site, commercial or not — we only ask that you leave the "by SharpTally" credit link under it in place.

Search calculators

Browse