Gross Margin Calculator

Work out gross margin from a cost and a selling price, or go the other way: enter your cost and a target margin to get the price you need to charge. Shows the equivalent markup so you do not confuse the two.

—

Formula

Gross profit = price − cost; Margin % = gross profit ÷ price × 100; Price = cost ÷ (1 − target margin).

Examples

InputResult
$150 price, $100 cost33.33% margin, $50.00 gross profit
$49.99 price, $18.50 cost62.99% margin, $31.49 gross profit
$60 cost, 40% target margin$100.00 selling price
$200 price, 35% target margin$130.00 maximum cost

Margin and markup: the formulas used here

QuantityFormula
Gross profitSelling price − cost
Gross margin(Price − cost) ÷ price × 100
Markup(Price − cost) ÷ cost × 100
Price from a target marginCost ÷ (1 − target margin)
Cost from a price and target marginPrice × (1 − target margin)

The only difference between margin and markup is the denominator. Margin divides by the selling price; markup divides by the cost. Because the price is always larger than the cost, the same sale always shows a higher markup than margin.

Why the gap matters when you set prices

If you want a 30% margin but apply a 30% markup instead, you end up with a margin of only about 23.1%, and every sale earns less than you planned. This is the single most common pricing mistake, and it is why the two are shown side by side above.

Where these formulas come from

The definitions and formulas above are the standard gross-margin and markup definitions and are stated identically by four independent references checked on 2026-10-15: the Massachusetts state government small-business pricing guide (Chapter 4, Calculating Costs & Setting a Price), the Wikipedia article on gross margin, and the Xero glossary pages for the US and Australia. Only formulas all four agree on are used here.

Scope. "Cost" on this page means cost of goods sold only, what you paid for the item. It excludes rent, wages, advertising and other overheads, so the result is a gross margin, not a net margin. Margin cannot reach 100% (that would require a cost of zero); markup has no upper limit. This is an arithmetic tool, not accounting or tax advice.

Frequently Asked Questions

What is the difference between margin and markup?

Both describe the same profit, but divide by different numbers. Margin divides the profit by the selling price; markup divides it by the cost. Since the price is larger than the cost, markup always comes out higher for the same sale. A $100 cost sold for $150 is a 50.00% markup but a 33.33% margin.

How do I calculate a 40% margin?

Divide your cost by (1 − 0.40), which is 0.60. A $60 cost therefore needs a $100.00 selling price. The same answer comes out of this calculator by choosing "selling price for a target margin".

Why is a 50% markup not the same as a 50% margin?

A 50% markup on a $100 cost gives a $150 price. The $50 profit is half the cost but only a third of the $150 price, so the margin is 33.33%, not 50%. Aiming for a margin and applying the same number as a markup leaves you underpriced on every sale.

Can margin ever be higher than markup?

No. Because the selling price is always at least as large as the cost, dividing the same profit by the larger number can only give a smaller percentage. If a calculation shows margin above markup, one of the two has been worked out against the wrong base.

What cost should I enter?

Enter the cost of goods sold: what you paid to buy or produce the item, including freight-in and packaging if you want a truer figure. Leave out rent, salaries, advertising and other overheads, which is why the result here is a gross margin rather than a net margin.

Why does the calculator refuse a 100% margin?

A 100% margin means the entire selling price is profit, which requires a cost of zero. Any real cost gives a margin below 100%. Markup has no such ceiling: a 100% markup is simply a price twice the cost.

Related Calculators

Markup Calculator: Set a Price From Cost, or Find Your MarkupSegment Pricing Calculator: Twilio Segment Cost by MTUZendesk Pricing Calculator: Cost per Agent and Total Monthly BillAirwallex Pricing Calculator: Fees, FX Markup and Card CostsStripe Atlas Cost Calculator: What a Delaware Company Really Costs to KeepDocuSign Pricing Calculator: Seats, Envelopes and the Real Annual CostNew Relic Pricing Calculator: Users, Data Ingest and the 5-Seat CliffExpensify Pricing Calculator: Members, Active Users and When Control Beats CollectPagerDuty Pricing Calculator: Per-User vs Platform Fee, and What a Seat Really CostsMixpanel Pricing Calculator: The First 1M Events Are Free, and Growth Stops at 20MQuickBooks Pricing Calculator: 1, 3, 5 or 25 Users, and Why 6 Costs $200 MoreAmplitude Pricing Calculator: The Plus Ladder Amplitude Doesn't PrintShipStation Pricing Calculator: The Same $174.99 Buys 5,000 or 2,000 Shipments