Skip to content
Pricing & margin

Gross margin calculator — margin, markup and target price

Calculate gross margin from revenue and COGS. Get gross profit, margin %, markup %, margin per unit, and the price you need for a target margin.

Free · no signup · runs in your browserUpdated
Short answer

Gross margin is gross profit divided by revenue, where gross profit is revenue minus cost of goods sold. On $4,850,000 of revenue and $3,152,500 of COGS, gross profit is $1,697,500 and gross margin is 35.0%. The same profit expressed against cost is a 53.8% markup, so cost-plus pricing needs a 1.538 multiplier.

Gross margin is the first number anyone looks at when a business grows but the profit does not. This gross margin calculator turns revenue and COGS into gross profit, margin percentage, the equivalent markup, and the price you would need to charge to hit a target.

It also runs the sensitivity that matters in a pricing meeting: what a 1%, 3% or 5% price rise does to gross profit, next to what an equivalent cut in COGS does. On a 35% margin the two are not interchangeable, and the table shows why.

Your numbers

$

Net sales — after returns, credit memos and trade discounts, before tax.

$

Materials, direct labour, inbound freight, duty and absorbed variable overhead. Keep the definition constant across periods.

units

Same UOM as your item master, or the per-unit figures will not tie.

%

The margin you are aiming for. Divided into cost, never added to it.

Result

Gross margin
35.0%

$1,697,500 of gross profit on $4,850,000 of revenue

Gross profit$1,697,500
Markup on cost53.8%
Revenue / cost per unit$125.00 / $81.25
Gross profit per unit$43.75
Price for a 40% margin$135.42
Revenue needed at today's COGS$5,254,167
Price rises versus COGS cuts. Price adds more gross profit; a cost cut lifts the percentage further because revenue is unchanged.
ChangeRevenueGross profitGross margin
Price +1%$4,898,500$1,746,00035.6%
Price +3%$4,995,500$1,843,00036.9%
Price +5%$5,092,500$1,940,00038.1%
COGS −3%$4,850,000$1,792,07537.0%
COGS −5%$4,850,000$1,855,12538.3%
gross profit = $4,850,000 − $3,152,500 = $1,697,500
gross margin = $1,697,500 ÷ $4,850,000 = 35.0%
markup on cost = $1,697,500 ÷ $3,152,500 = 53.8%
per unit (38,800) = $125.00 − $81.25 = $43.75
price for 40% = $81.25 ÷ (1 − 0.40) = $135.42
Gross margin of 35.0% is 5.0 points below the 40.0% target. Closing it takes either a price of $135.42 per unit (8.3% above today's $125.00) or a unit cost of $75.00 (7.7% below today's $81.25). Price is the faster lever; cost is the one that survives a competitor's response.

Everything is computed in your browser. Nothing you type is sent anywhere or stored.

The formula

Gross margin % = (Revenue − COGS) ÷ Revenue × 100 · Price for target margin = Unit cost ÷ (1 − Target margin)
Revenue
Net sales for the period — after returns, credits and trade discounts, before tax.
COGS
Direct cost of what you sold: materials, direct labour, inbound freight, duty and variable overhead absorbed into the product.
Unit cost
COGS ÷ units sold. Used to price a single item to a target margin.
Target margin
The margin you want, as a decimal. Divide into cost — never add to it.

Gross margin sits above operating expenses, so it measures pricing and production, not overhead control. Whatever you put in COGS must stay there every period: moving inbound freight in or out of COGS shifts margin by a point or two and makes the trend meaningless.

Worked example

Revenue
$4,850,000
Cost of goods sold
$3,152,500
Units sold
38,800
Target gross margin
40%
Result
Gross profit $1,697,500 · 35.0% margin · 53.8% markup

$4,850,000 − $3,152,500 = $1,697,500 of gross profit, which is 35.0% of revenue. Per unit that is $125.00 of revenue against $81.25 of cost, or $43.75 of margin. To reach the 40% target you need to price at $81.25 ÷ 0.60 = $135.42, an 8.3% increase — or hold price and cut unit cost to $75.00, a 7.7% reduction.

Margin ladder at a fixed unit cost

At the example's $81.25 unit cost, each target margin implies exactly one price. Read down the column before you promise a margin improvement — the price move is usually larger than people expect.

Target marginEquivalent markupPrice neededGross profit per unit
25%33.3%$108.33$27.08
30%42.9%$116.07$34.82
35%53.8%$125.00$43.75
40%66.7%$135.42$54.17
45%81.8%$147.73$66.48
50%100.0%$162.50$81.25
Unit cost held at $81.25. Price = cost ÷ (1 − target margin).

How to improve gross margin

Four levers, in rough order of speed. Price is fastest and most contested; mix is slowest and most durable.

  1. 1.Stop the leakage before raising list price. Off-invoice discounts, unbilled freight and rebate accruals often cost more margin than the list price would gain. Model the stack in the discount cascade calculator.
  2. 2.Fix the cost basis. If inbound freight and duty are outside COGS, item margins are overstated and the worst offenders look fine. See the landed cost calculator.
  3. 3.Shift mix towards the lines that carry margin. Revenue-neutral, margin-positive, and it needs no customer conversation — but it needs item-level margin you trust.
  4. 4.Then move price, selectively. A 3% rise on the third of your catalogue with the least price sensitivity beats 1% across the board and is easier to defend.

Where gross margin gets reported wrong

  • Revenue gross of credits. Return credits posted to a separate account inflate revenue and flatter margin, usually by more than a point in distribution.
  • Absorbed overhead drifting. Standard cost rates set once a year mean the variance, not the margin, moves — check purchase price variance alongside the margin trend.
  • Freight recovery netted against revenue in one entity and against COGS in another. Consolidated margin then averages two different definitions.
  • Item margin that never ties to the GL. If the sum of item margins misses the general ledger by more than a rounding difference, the item costs are stale.
  • Comparing margin across periods with a different product mix and calling it a pricing result.

Assembling the inputs

Revenue net of credits, COGS on the same basis every period, units on the same UOM, split by item class — that is a saved search, an export and a reconciliation. The reconciliation is the part that takes the afternoon.

Ask for "gross margin by item class this quarter versus last, net of credit memos" and the answer arrives with the query beneath it, so you can check whether freight was in COGS before you take the number to a pricing meeting.

Frequently asked questions

How do you calculate gross margin?

Subtract cost of goods sold from revenue to get gross profit, then divide gross profit by revenue and multiply by 100. With $4,850,000 of revenue and $3,152,500 of COGS, gross profit is $1,697,500 and gross margin is 35.0%. Use net revenue, after returns and credits.

What is a good gross margin?

It depends almost entirely on the model. Distributors commonly run in the teens to low twenties, discrete manufacturers in the thirties, and software far higher. The useful comparison is your own trend and your own item classes, because a single company average hides the lines that lose money.

What is the difference between gross margin and gross profit?

Gross profit is the dollar amount — revenue minus COGS. Gross margin is that amount as a percentage of revenue. $1,697,500 of gross profit on $4,850,000 of revenue is a 35.0% gross margin. Profit pays the bills; margin tells you whether pricing and production are working.

What price do I need for a 40% gross margin?

Divide unit cost by 0.60. At $81.25 of unit cost that is $135.42, not the $113.75 you get by adding 40% to cost — that would deliver only a 28.6% margin. Always divide the cost by one minus the target margin.

Should freight be included in COGS?

Inbound freight and duty belong in COGS, because they are part of what the goods cost you to own. Outbound freight to the customer is a selling cost and sits below gross profit, unless you bill it separately. Pick one convention and keep it, or the margin trend becomes noise.

Why did revenue grow while gross margin fell?

Usually mix, not price. Growth concentrated in lower-margin lines or larger customers on deeper discounts lowers the average while every individual price stays intact. Decomposing the change into price, volume and mix effects separates the three so you know which one to act on.

All 50 ERP & finance tools

Stop calculating it by hand. Just ask your ERP.

This calculator needs you to find the inputs first. ERPray pulls them from your own ERP account and computes the answer live — with the exact query shown so you can check it.