Margin formula
Margin % = (Price − Cost) ÷ Price × 100
Price = Cost ÷ (1 − Margin÷100)
These are standard gross-margin identities used in retail and accounting textbooks, not a proprietary model. They ignore taxes, fees, and multi-step COGS allocations.
Pricing scenarios worked step by step
Retail: hitting a 35% margin
A shop pays $18.00 for a jacket and wants a 35% gross margin. Use the price-from-margin mode, or do it by hand: price = cost ÷ (1 − 0.35) = 18 ÷ 0.65 = $27.69. Check: profit is 27.69 − 18.00 = $9.69, and 9.69 ÷ 27.69 = 35.0%. The tempting shortcut of 18 × 1.35 = $24.30 only yields (24.30 − 18) ÷ 24.30 = 25.9% margin, because 35% was applied to cost instead of price.
Restaurant: pricing a dish from its food cost
Ingredients for a pasta dish cost $4.80 per plate. If the target food cost is 30% of the menu price, then the margin on ingredients is 70%. Price = 4.80 ÷ 0.30 = $16.00. Check: 16.00 − 4.80 = $11.20, and 11.20 ÷ 16.00 = 70%. This is gross margin on ingredients only; labor and rent come out of that $11.20.
E-commerce: margin after shipping and fees
A product sells for $50.00. It costs $22.00, shipping is $6.00, and the payment processor takes 3% of the price ($1.50). Total cost = 22.00 + 6.00 + 1.50 = $29.50. Profit = 50.00 − 29.50 = $20.50, so margin = 20.50 ÷ 50.00 = 41%. Using product cost alone would suggest (50 − 22) ÷ 50 = 56%, which overstates real profitability by 15 points. Enter the full landed cost as the cost field to get the honest figure.
Margin and markup equivalents
Markup = margin ÷ (1 − margin). The same profit looks bigger as a markup because the denominator (cost) is smaller than the price.
| Gross margin | Equivalent markup | Price on $100 cost |
|---|---|---|
| 20% | 25% | $125.00 |
| 25% | 33.33% | $133.33 |
| 30% | 42.86% | $142.86 |
| 33.33% | 50% | $150.00 |
| 40% | 66.67% | $166.67 |
| 50% | 100% | $200.00 |
| 60% | 150% | $250.00 |
Common mistakes
- Adding the margin percentage to cost. A 40% margin needs price = cost ÷ 0.60 (cost × 1.667), not cost × 1.40.
- Mixing up margin and markup in quotes. Agree on which one a supplier or client means before comparing numbers.
- Ignoring discounts. A 20% sale on a 40% margin item does not leave 20%. On a $100 price with $60 cost, an $80 sale price gives (80 − 60) ÷ 80 = 25% margin.
- Leaving out variable costs. Shipping, packaging, returns, and fees all belong in cost if they scale with each sale.
- Confusing gross margin with net margin. This tool measures only price versus the cost you enter, not overhead or taxes.
When to use this vs related tools
Use the margin calculator when you think in terms of a share of revenue (reporting, comparing products, setting a target profit share). If your supplier or price list is built as cost plus a percentage, switch to the markup calculator. To see how a promotion changes your price before re-checking margin, try the discount calculator. For more business and money tools, browse the finance calculators. This page is educational and not financial advice.