Profit Margin Calculator
Work out gross profit, margin and markup side by side — or reverse it to find the price you need for a target margin.
Most people use 'revenue + cost' to see the margin. When pricing, use 'revenue + margin' to find the maximum cost, or 'cost + margin' to find the price to charge.
Use the same basis for revenue and cost (both with or both without sales tax); revenue must be above 0.
Cost of goods sold (purchase or production cost), not overheads; cost ≥ 0.
Gross profit = revenue − cost = $40.00; gross margin = profit ÷ revenue = 40% (divided by revenue); markup = profit ÷ cost = 66.67% (divided by cost). Margin and markup are different — don't mix them up.
How to use
- Choose what you know: Revenue + cost, revenue + target margin, or cost + target margin.
- Enter the two numbers: Keep revenue and cost on the same tax basis.
- Read margin and markup: You get gross profit, gross margin and markup, plus the missing price or cost.
Margin and markup formulas
Gross profit = revenue − cost Gross margin = profit / revenue × 100% Markup = profit / cost × 100% Price for a target margin = cost / (1 − margin)
Sell for 100 something that costs 60: gross profit is 40, the margin is 40% and the markup is 66.7%. Same profit, different denominator.
To earn a 40% margin on an item that costs 60, price it at 60 / (1 − 0.4) = 100. Adding 40% to the cost (84) only gives a 28.6% margin — the classic pricing mistake.
Gross margin vs net margin, and what belongs in cost
Gross margin only subtracts the direct cost of what you sold: the purchase price or materials, inbound shipping, packaging and per-order fees such as card or marketplace commissions. Rent, salaries, software and advertising are overheads; they come out later and are what separates gross margin from net profit margin.
That is why a business can show a healthy 45% gross margin and still lose money: if overheads eat 50% of revenue, the net margin is −5%. When you set prices, check both numbers. Gross margin tells you whether each sale is worth making; net margin tells you whether the business as a whole pays you.
Keep the tax basis consistent. Compare revenue and cost both before sales tax or VAT, or both after it; mixing the two inflates or shrinks the margin by the tax rate. If you sell through several channels with different fees, work out the margin per channel rather than one blended number.
Frequently asked questions
- How do you calculate gross profit margin?
- Subtract cost from revenue to get gross profit, then divide by revenue. Revenue 100, cost 60: profit 40, margin 40 / 100 = 40%.
- What is the difference between margin and markup?
- Margin divides profit by the selling price; markup divides it by the cost. A 40% margin equals a 66.7% markup, and a 50% markup is only a 33.3% margin.
- How do I set a price for a target margin?
- Divide the cost by (1 − target margin). For a 30% margin on a cost of 70: 70 / 0.7 = 100.
- What is a good gross margin?
- It varies widely by industry: grocery retail often runs at 20–30%, restaurants around 60–70% on food cost, software above 70%. Compare with businesses like yours, then check that the margin also covers rent, wages and other overheads.
- Is gross margin the same as net profit margin?
- No. Gross margin subtracts only the cost of goods sold; net margin also subtracts rent, wages, marketing, interest and tax. A 40% gross margin often ends up as a 5–15% net margin for a small retailer.
- Can profit margin be more than 100%?
- Margin cannot exceed 100% because profit can never be larger than the selling price. Markup can: buying at 20 and selling at 100 is an 80% margin but a 400% markup.