Margin Calculator
Calculate profit margin from cost and revenue, or find the required revenue for a target margin. Includes markup comparison. See also Markup Calculator and Discount Calculator.
How to Calculate Profit Margin
Profit margin (also called gross margin) is the percentage of revenue that remains as profit after subtracting the cost. Unlike markup (which is based on cost), margin is based on the selling price or revenue. A 40% margin means that for every dollar of revenue, 40 cents is profit. Margin is widely used in financial analysis because it directly shows what portion of sales translates to profit, making it easier to compare profitability across different products or businesses.
Margin Formula
Margin % = ((Revenue − Cost) / Revenue) × 100
To find revenue from target margin:
Revenue = Cost / (1 − Margin% / 100)
Converting between margin and markup:
Margin = Markup / (1 + Markup)
Markup = Margin / (1 − Margin)
Example Calculation
Cost: $60.00
Revenue: $100.00
Profit = $100 − $60 = $40.00
Margin = 40 / 100 × 100 = 40%
Markup = 40 / 60 × 100 = 66.67%
Cost Ratio = 60 / 100 × 100 = 60%
Margin Reference Table
| Cost | Revenue | Profit | Margin | Markup |
|---|---|---|---|---|
| $60 | $100 | $40 | 40.00% | 66.67% |
| $70 | $100 | $30 | 30.00% | 42.86% |
| $80 | $100 | $20 | 20.00% | 25.00% |
| $50 | $100 | $50 | 50.00% | 100.00% |
| $25 | $100 | $75 | 75.00% | 300.00% |
| $40 | $80 | $40 | 50.00% | 100.00% |
Frequently Asked Questions
What is the difference between margin and markup?
Margin is profit as a percentage of revenue (selling price), while markup is profit as a percentage of cost. For the same transaction, margin is always lower than markup. A 50% markup equals a 33.33% margin. A 100% markup equals a 50% margin.
What is a good profit margin?
Good margins vary by industry. Software companies often achieve 70-90% gross margins. Retail typically sees 25-50%. Restaurants average 3-9% net margin. Manufacturing ranges from 10-30%. Compare within your industry for meaningful benchmarks.
Can margin be over 100%?
No. Margin is calculated as a percentage of revenue, so it can never reach or exceed 100%. A 99% margin means cost is only 1% of revenue. Markup, however, can exceed 100% (a 200% markup means selling at 3x cost).
What is gross margin vs net margin?
Gross margin only considers the direct cost of goods sold (COGS). Net margin accounts for all expenses including overhead, taxes, interest, and operating costs. Net margin is always lower than gross margin and gives a more complete picture of profitability.
Why do businesses use margin instead of markup?
Margin directly shows what percentage of revenue is profit, making it easier to calculate profitability from sales figures. Financial statements report margins, and investors use margin to compare companies. Markup is more useful for pricing individual products.
Solved Examples
Example 1: E-commerce product profit margin
Solution:
Selling price = $89.99, Cost (COGS) = $42.00
Profit = Revenue - Cost = $89.99 - $42.00 = $47.99
Profit Margin = Profit / Revenue × 100
Margin = $47.99 / $89.99 × 100 = 53.3%
Answer: The profit margin is 53.3% — you keep $47.99 of every $89.99 sale.
Example 2: Setting selling price from target margin
Solution:
Cost = $35, Target margin = 40%
Selling Price = Cost / (1 - Margin)
Selling Price = $35 / (1 - 0.40) = $35 / 0.60 = $58.33
Verification: ($58.33 - $35) / $58.33 = 40% ✓
Answer: Price the product at $58.33 to achieve a 40% profit margin.
Example 3: Gross margin vs net margin for a business
Solution:
Revenue = $500,000, COGS = $200,000, Operating expenses = $150,000
Gross Profit = $500,000 - $200,000 = $300,000
Gross Margin = $300,000 / $500,000 × 100 = 60%
Net Profit = $300,000 - $150,000 = $150,000
Net Margin = $150,000 / $500,000 × 100 = 30%
Answer: Gross margin = 60%, Net margin = 30%. Operating expenses consume half the gross profit.
Practice Questions
Try these on your own:
- A product sells for $120 with a cost of $72. What is the profit margin? (Answer: 40%)
- Your cost is $50. What selling price gives you a 60% margin? (Answer: $125)
- Revenue is $1M with COGS of $650,000. What is the gross margin? (Answer: 35%)
- If margin is 25%, what is the equivalent markup percentage? (Answer: 33.3%)
- A company has 45% gross margin and 12% net margin. What percentage of revenue goes to operating costs? (Answer: 33%)
- Cost = $18, selling price = $30. Calculate both margin and markup. (Answer: Margin = 40%, Markup = 66.7%)
Common Mistakes to Avoid
The number one mistake is using markup and margin interchangeably. If your cost is $60 and you add a 50% "margin," you might price at $90 thinking your margin is 50% — but $30/$90 = 33.3% margin, not 50%. To hit a 50% margin, you need to price at $120 ($60/0.50). Another common error is calculating margin on cost instead of revenue — margin is ALWAYS a percentage of the selling price. Businesses also frequently forget to include all variable costs in COGS (shipping, payment processing fees, packaging) which inflates the perceived margin. Additionally, comparing margins across different industries is misleading: software companies average 70-80% gross margins while grocery stores average 25-30%. Finally, focusing solely on margin percentage without considering volume can be a trap — a 10% margin on $1M revenue ($100K profit) beats a 50% margin on $100K revenue ($50K profit).
Key Takeaways
- Profit Margin = (Revenue - Cost) / Revenue × 100. It's always based on selling price, not cost.
- To find selling price from target margin: Price = Cost / (1 - Margin%).
- Margin is always lower than markup for the same product: 50% markup = 33.3% margin.
- Healthy margins vary by industry: SaaS (70-80%), retail (50-60%), grocery (25-30%), restaurants (60-70% gross).
- Gross margin covers COGS only; net margin accounts for all expenses including operating, interest, and taxes.
- Track margin trends over time — declining margins signal rising costs or pricing pressure.