Profit Margin Calculator: Gross Margin, Net Margin, and the Markup Confusion
Margin and markup are not the same thing — and mixing them up is one of the most common and costly pricing mistakes in small business. This calculator computes all three metrics from two inputs (cost and selling price), but understanding what each number means is what turns the output into better pricing decisions.
The Three Core Formulas
Gross Margin (%):
Gross Margin = (Revenue - COGS) / Revenue x 100
Where COGS (Cost of Goods Sold) includes the direct cost of producing or acquiring the product: materials, direct labor, and allocated manufacturing overhead. Gross margin tells you what percentage of each sale is available to cover operating expenses and generate profit.
Markup (%):
Markup = (Selling Price - Cost) / Cost x 100
Markup is cost-based: it expresses profit as a percentage of the cost. A 100% markup on a MXN 100 product means you sell it for MXN 200 — but that is a 50% gross margin, not 100%.
Net Margin (%):
Net Margin = Net Income / Revenue x 100
Net income = Revenue minus all expenses: COGS, operating expenses, depreciation, interest, and taxes. Net margin is the bottom line — what percentage of revenue actually becomes profit after every cost is accounted for.
Why Margin and Markup Are Not the Same — A Worked Example
A retailer sources a product at MXN 100 and sells it at MXN 250.
- Markup: (250 - 100) / 100 x 100 = 150%
- Gross Margin: (250 - 100) / 250 x 100 = 60%
Same transaction, two very different-looking numbers. Many SMB owners target a "50% margin" but actually calculate "50% markup" — which is only a 33% gross margin. The result: they underprice systematically, especially after adding shipping, returns, and overhead. The correct calculation: if your target is 60% gross margin, set your price at Cost / (1 - 0.60) = Cost x 2.5.
Conversion formulas:
Margin to Markup: Markup % = Margin % / (1 - Margin %)
Markup to Margin: Margin % = Markup % / (1 + Markup %)
Contribution Margin vs Gross Margin
Gross margin uses COGS (which may include fixed production overhead). Contribution margin separates only variable costs:
Contribution Margin = (Revenue - Variable Costs) / Revenue x 100
Contribution margin is more useful for break-even analysis and incremental pricing decisions. If you are deciding whether to take a bulk order at a 10% discount, the relevant question is whether the discounted price exceeds your variable cost — not whether it exceeds your average COGS.
2026 Industry Benchmark Table
| Industry | Typical Gross Margin | Typical Net Margin |
|---|---|---|
| SaaS / software | 70-85% | 10-25% |
| E-commerce / retail | 25-45% | 2-8% |
| Restaurants / food service | 60-70% (food cost inverted) | 5-15% |
| Manufacturing | 20-35% | 5-12% |
| Professional services | 50-70% | 15-30% |
| Construction | 15-25% | 2-8% |
| Artisan bakery (Mexico) | 65-72% food cost inverted | 6-12% |
Note: restaurant industry convention is to report "food cost" (the inverse of gross margin on food) rather than gross margin. A 32% food cost = 68% gross margin on food revenue.
Pricing Strategy: How to Use Margin to Set Prices
Cost-plus pricing starts from COGS and adds the desired markup: Selling Price = Cost x (1 + Markup). Simple to implement but ignores what customers are willing to pay and what competitors charge.
Target-margin pricing sets the selling price to achieve a desired gross margin: Selling Price = Cost / (1 - Target Gross Margin). Example: cost MXN 80, target 60% margin. Price = 80 / (1 - 0.60) = MXN 200.
Value-based pricing sets price based on perceived value to the customer, working backwards to verify the resulting margin is acceptable. Software and professional services companies that achieve 80%+ gross margins are almost never using cost-plus — they are anchoring price to customer ROI.
Competition-based pricing sets price at or near market price, then evaluates whether the resulting margin is sustainable. Retail commodities and e-commerce marketplaces often force this approach.
How to Use This Calculator Step by Step
- Enter the unit cost (COGS per unit): what you pay to produce or source each item.
- Enter the selling price (what the customer pays, before any taxes that you remit to the government, e.g., before IVA if you do not keep IVA).
- Read gross margin % — this is the per-unit contribution to overhead and profit.
- Read markup % — this is how much above cost you are pricing.
- Add operating costs (rent, labor, marketing as % of revenue) to estimate net margin.
Common Mistakes
- Including taxes in cost but not in selling price (or vice versa). Always keep cost and price on the same tax basis (both ex-IVA or both inclusive). Mixing bases inflates or deflates margin.
- Confusing markup and margin. A 50% markup is not a 50% margin. See formulas above.
- Ignoring volume effects. High gross margin means nothing if fixed overhead is not covered. At 100 units/month vs 1,000 units/month, net margin can swing from negative to 20%.
- Not accounting for returns and discounts. Effective margin = (gross revenue minus returns minus discounts) minus COGS. SaaS companies with high refund rates and ecommerce stores with 20%+ return rates see real margins significantly below calculator output.
- Treating one-time cost spikes as permanent COGS. A shipping surcharge during peak season is not a permanent change in COGS; do not let it permanently reset your prices.
Target Gross Margin by Pricing Tier
For product businesses, gross margin targets should scale with the pricing strategy:
- Commoditized products (identical to competition): 15-30% gross margin is typical; compete on volume and operational efficiency.
- Differentiated products (branded, quality, unique features): 40-60% gross margin is achievable; value-based pricing reinforces differentiation.
- Premium or luxury products: 60-80% gross margin; brand premium supports pricing above functional value.
A business with 25% gross margin and 12% operating expenses has 13% EBIT margin. A business with 60% gross margin and the same operating expense rate has 48% EBIT margin — identical revenue, dramatically different profitability. Gross margin is the multiplier that determines how much operating leverage each dollar of additional revenue generates.
Real SMB Case: Cafeteria in Mexico City Improving Net Margin
A small cafeteria in Colonia Roma, Mexico City, had 2023 revenue of MXN 1,200,000/year and food cost of MXN 516,000 (43% food cost = 57% gross margin). Operating costs (rent MXN 18,000/month, 2 employees, utilities) totaled MXN 420,000. Net income: MXN 264,000 = 8.3% net margin.
The owner ran a margin analysis by product and found that three items — a house sandwich, a smoothie, and a specialty coffee — had food cost below 25% but were underpriced by comparison to similar items nearby. Repricing these three items 15% upward (an average of MXN 12 per item) while eliminating two high-food-cost items (a steak plate at 62% food cost and a fruit bowl at 55%) shifted the revenue mix.
2024 result: revenue MXN 1,180,000 (slightly down from menu simplification), food cost MXN 446,000 (37.8% food cost = 62.2% gross margin), same operating costs. Net income MXN 314,000 = 14.1% net margin — a 70% improvement in net profit from menu re-engineering, with no increase in customer count.