How gross margin works
Every sale splits into two parts: the cost of the thing you sold and the profit left over. Gross margin expresses that profit as a percentage of the selling price, so it tells you how much of each dollar of revenue you actually keep before the wider costs of running the business. Because it’s measured against price rather than cost, it can’t exceed 100% and it’s always a smaller percentage than the equivalent markup. Get it the wrong way round and you’ll price too low and quietly erode your profit.
The margin formula
Margin % = (Price − Cost) ÷ Price × 100
The numerator, Price − Cost, is your gross profit per unit; dividing by the price turns it into a share of revenue. For a $60 cost sold at $100: (100 − 60) ÷ 100 × 100 = 40%. To go the other way and set a price from a target margin, rearrange toPrice = Cost ÷ (1 − margin).
What makes this calculator different
- Works in both directions. Solve for the margin from a cost and price, or flip it to find the price that hits a target margin — no re-deriving the formula by hand.
- Margin vs markup, side by side. The result shows the equivalent markup too, so you can see why the same profit looks like a bigger percentage when measured against cost.
- Profit in dollars, not just percent. Alongside the margin you get the gross profit per unit, the number that actually lands in your account.
- Shareable. Your figures live in the URL, so you can send a pricing scenario to a partner or save it for later.
Frequently asked questions
What is gross margin and how do I calculate it?+
Gross margin is the share of each sale you keep as profit after covering the direct cost of the item you sold. The formula is margin = profit ÷ revenue × 100, where profit is selling price minus cost. For an item that costs $60 and sells for $100, the profit is $40, so the margin is 40 ÷ 100 × 100 = 40%. Enter your cost and selling price above and the calculator returns the margin instantly.
What’s the difference between margin and markup?+
Margin and markup describe the same dollar of profit but measure it against different numbers, so they’re never equal. Margin is profit as a percentage of the selling price, while markup is profit as a percentage of the cost. On a $60 item sold for $100, the $40 profit is a 40% margin (40 ÷ 100) but a 67% markup (40 ÷ 60). Markup is always the larger figure, and confusing the two is one of the most common pricing mistakes.
What is a good profit margin?+
There’s no universal “good” margin — it varies enormously by industry and business model. Grocery and other high-volume retail often run on razor-thin margins of just a few percent, because they make money on turnover rather than per-sale profit. Software and digital products, where the cost to deliver one more copy is near zero, can sustain very high margins. The useful comparison is against typical margins in your own industry, not a single benchmark number.
How do I price a product to hit a target margin?+
Work backward from the margin you want using price = cost ÷ (1 − margin), with the margin written as a decimal. To earn a 40% margin on a $60 item: $60 ÷ (1 − 0.40) = $60 ÷ 0.60 = $100. Notice you don’t simply add 40% to the cost — that would set the markup, not the margin, and leave you short. Flip this calculator to its target-margin mode to do the division for you.
Is margin the same as profit?+
No. Profit is a dollar amount — the selling price minus the cost — while margin is that profit expressed as a percentage of revenue. A $40 profit is the same dollars whether the item sells for $100 (a 40% margin) or $400 (a 10% margin), but the margin tells you how efficiently each sale converts to profit. Margin lets you compare products and price points on equal footing regardless of their dollar size.
Disclaimer: This calculator is for educational purposes only. The figures it returns are gross margin — profit before operating expenses, overhead, and taxes — so your net margin will be lower once those costs are accounted for. It is not financial advice.