Gross Margin Calculator
Calculate gross margin, markup and gross profit from your revenue and cost of goods. See the difference between margin and markup with the formula and an example.
Updated 2026-06-14 · Free · No sign-up · Runs privately in your browser
Show the formula & steps
How the Gross Margin Calculator Works
Gross margin tells you what fraction of each sales dollar is left after paying for the product itself. This calculator takes your revenue (selling price) and cost of goods sold (COGS) and instantly returns your gross profit, gross margin percentage, and the equivalent markup percentage.
It is built to clear up the most common point of confusion in pricing: margin and markup use the same profit but divide by different denominators.
The Formula
Gross profit = revenue − COGS Gross margin % = (gross profit ÷ revenue) × 100 Markup % = (gross profit ÷ COGS) × 100
Margin is measured against the selling price, markup against the cost. Because cost is usually smaller than price, the markup percentage is always larger than the margin percentage for the same sale.
Worked Example
Selling a product for $100 that costs $60:
- Gross profit = 100 − 60 = $40
- Gross margin = 40 ÷ 100 = 40%
- Markup = 40 ÷ 60 = 66.67%
So a 40% margin and a roughly 67% markup describe the same transaction.
Margin vs Markup at a Glance
| Markup | Equivalent margin |
|---|---|
| 25% | 20% |
| 50% | 33.3% |
| 67% | 40% |
| 100% | 50% |
| 150% | 60% |
Use margin when you want to know profitability as a share of sales, and markup when you are setting a price from a known cost.
Frequently asked questions
How do I calculate gross margin?+
Gross margin is gross profit divided by revenue, expressed as a percentage. Subtract the cost of goods sold from revenue to get gross profit, then divide by revenue and multiply by 100. For example, selling for $100 at a $60 cost gives $40 profit and a 40% gross margin.
What is the difference between margin and markup?+
Both use the same dollar profit, but they divide by different numbers. Margin divides profit by the selling price (revenue), while markup divides profit by the cost. A $40 profit on a $60 cost is a 40% margin but a 67% markup, so markup is always the larger percentage.
What is a good gross margin?+
It depends on the industry. Software and digital products often see margins above 70%, retail typically runs 20% to 50%, and grocery or commodity businesses may operate on single-digit margins. Compare your margin to others in your sector rather than to a single universal target.
How do I convert markup to margin?+
Use margin = markup ÷ (1 + markup), with both as decimals. A 67% markup becomes 0.67 ÷ 1.67 = 0.40, or a 40% margin. To go the other way, markup = margin ÷ (1 − margin), so a 40% margin is 0.40 ÷ 0.60 = 0.67, a 67% markup.
Does gross margin include operating expenses?+
No. Gross margin only subtracts the direct cost of goods sold, such as materials and direct labor. It does not include rent, salaries, marketing or other overhead. After those operating expenses you get operating margin, and after interest and taxes you get net profit margin.