Margin Calculator
Find your gross profit margin from cost and price — or work backward to the price a target margin requires.
The margin formulas
Price for target margin = Cost ÷ (1 − target margin)
Cost $40, price $60: margin = (60 − 40) ÷ 60 = 33.3%, profit $20.
Want a 40% margin on that $40 cost? Price = 40 ÷ 0.60 = $66.67.
A shop sells two products in a month: 100 units of Product A (cost $40, price $60 — a 33.3% margin, $2,000 total profit on $6,000 revenue) and 50 units of Product B (cost $10, price $25 — a 60% margin, $750 total profit on $1,250 revenue).
Blended margin = total profit ÷ total revenue = $2,750 ÷ $7,250 = 37.9%. Simply averaging the two margin percentages — (33.3% + 60%) ÷ 2 = 46.65% — would overstate the true blended margin by nearly 9 points, because it ignores that Product A generated far more revenue than Product B.
Margin vs. markup — don't mix them
Both describe the same profit, divided by different denominators. Margin uses the selling price; markup uses the cost. A 50% markup equals a 33% margin. Businesses that price using markup but report using margin can badly misjudge profitability. Remember gross margin ignores overhead — rent, salaries, marketing — so net margin is always lower; find the sales volume that covers fixed costs with the break-even calculator, and price from cost-plus with the markup calculator.
Gross margin vs. net margin by industry
| Industry | Typical gross margin | Typical net margin |
|---|---|---|
| Software / SaaS | 60%–80% | 10%–25% |
| Professional services | 40%–60% | 10%–20% |
| Retail (general) | 25%–40% | 2%–8% |
| Restaurants | 60%–70% (food only) | 3%–9% |
| Grocery | 20%–25% | 1%–3% |
The gap between gross and net margin is entirely overhead — rent, payroll, marketing, insurance, interest, and taxes. A restaurant's food-only gross margin looks similar to software's, but its net margin is dramatically lower because of labor and rent, which is why gross margin alone is a poor proxy for how profitable a business actually is.
Common margin mistakes
- Averaging margin percentages instead of weighting by revenue. As the blended-margin example above shows, a simple average can overstate true profitability when product mix is uneven.
- Reporting gross margin as if it were net margin. Gross margin ignores overhead entirely — always specify which one you mean.
- Using the markup formula (cost × (1 + markup)) when a margin target was actually intended. Divide by (1 − margin), don't multiply by (1 + margin) — see the markup calculator for the full conversion.
Frequently asked questions
How do I calculate profit margin?
(Price − Cost) ÷ Price × 100. $40 cost, $60 price = 33.3%.
What is a good profit margin?
Industry-dependent: software 50–70%, retail 25–40%, grocery under 10%. Net margins are lower.
How do I price for a target margin?
Cost ÷ (1 − margin). 40% margin on $30 cost = $50.
How do I calculate blended margin across multiple products?
Total profit across all products ÷ total revenue across all products — not a simple average of each product's margin, which overweights low-revenue products.
What's the difference between gross margin and net margin?
Gross margin subtracts only direct product cost. Net margin subtracts everything — rent, salaries, marketing, taxes — so it's always lower.
Related calculators
Note: Gross margin only; excludes operating expenses and taxes. Industry figures are general ranges, not guarantees. Not financial advice. Last reviewed: September 2026.