Gross Margin Calculator
Enter revenue and cost of goods sold to find the gross margin percentage.
What the calculator returns
Enter revenue and cost of goods sold for any period. The calculator returns the gross margin as a percentage of revenue, which is the share of each sales dollar left after paying for the product itself. At the defaults — $1,000 of revenue and $600 of COGS — gross profit is $400 and the gross margin is 40.00%.
How the formula works
The numerator is gross profit: what remains after the direct cost of the goods sold. The denominator is revenue, so the result is a share of the selling price rather than a share of the cost. That is the whole distinction between margin and markup, and it is why a 50% markup produces only a 33.3% margin.
Because the denominator is revenue, the number is capped at 100% and can be negative if COGS exceeds revenue. It is also comparable across products of different prices: a $10 item with $6 of cost and a $1,000 item with $600 of cost both carry a 40% gross margin.
Worked example at the defaults
Gross profit: $1,000 − $600 = $400. Gross margin: $400 ÷ $1,000 = 0.40, or 40.00%. Scale the business to $25,000 of monthly revenue at the same margin and gross profit becomes $10,000, which is the pool that has to cover rent, salaries and everything else before the company earns a profit.
That last point is where the number earns its keep. A 40% gross margin on $25,000 leaves $10,000 of gross profit; if fixed costs are $9,000, the operating profit is $1,000. A two-point slip in margin — from 40% to 38% — removes $500 and halves that operating profit.
The same sale as margin and as markup
| Markup on cost | Selling price on $100 cost | Gross profit | Gross margin |
|---|---|---|---|
| 20% | $120 | $20 | 16.7% |
| 25% | $125 | $25 | 20.0% |
| 50% | $150 | $50 | 33.3% |
| 75% | $175 | $75 | 42.9% |
| 100% | $200 | $100 | 50.0% |
Every row is the same dollar profit expressed against a different base. Markup divides by the $100 cost, margin divides by the selling price, so the margin figure is always the smaller of the two. The conversion is margin = markup ÷ (100 + markup), and the reverse is markup = margin ÷ (100 − margin).
Typical gross margins by industry
| Business type | Typical gross margin | What drives it |
|---|---|---|
| Software and SaaS | 70%–85% | Near-zero cost per additional user |
| Restaurants | 55%–65% | Food and beverage cost of 28%–35% of sales |
| Specialty retail | 40%–55% | Brand pricing power and markdown levels |
| Construction | 15%–25% | Materials and subcontractor labor |
| Grocery | 20%–30% | Thin markup on high volume |
| Auto dealers | 10%–15% | Vehicle cost dominates the sale price |
The bands are wide because company strategy moves them more than industry averages do. A grocer at 30% and a grocer at 22% can both be profitable if the second runs leaner overhead and faster inventory turns. Comparing your 40% with a software company’s 80% says nothing useful; comparing it with your own margin last year says a great deal.
What moves the number
- Input costs. Raising COGS from $600 to $640 on $1,000 of revenue drops the margin from 40.0% to 36.0%.
- Price. A 5% price increase on the default sale, with no cost change, lifts revenue to $1,050 and the margin to 42.9%.
- Discounting. A 10% discount on the default item cuts gross profit from $400 to $300 and the margin to 33.3%.
- Product mix. Selling more of a low-margin item pulls the blended margin down even when every individual price holds.
- Shipping and payment fees. Treating them as COGS rather than overhead typically costs a retailer 2 to 4 points of margin.
Mistakes that distort the ratio
Putting overhead in COGS
COGS should include only costs that scale directly with the goods sold: materials, purchase cost, inbound freight, direct labor. Allocating rent or a manager’s salary into COGS lowers the reported margin and makes it incomparable with competitors who classify those costs as operating expenses. The ratio only means something if the definition is consistent.
Confusing gross margin with net margin
A 40% gross margin can coexist with a 2% net margin once payroll, marketing, rent and taxes are paid. Gross margin measures the product; net margin measures the business. A company with a 25% gross margin and tight overhead can outperform one with 60% and a large sales team.
- Recording discounts and returns as revenue, which inflates both sides of the ratio
- Excluding inbound freight from COGS and treating it as overhead
- Comparing a quarterly margin with an annual one that contains different seasonality
- Using margin to price a single item when the fixed cost base needs a different contribution
What the estimate leaves out
The calculator returns one ratio from two inputs, so it says nothing about volume, fixed costs or cash. A 60% margin on $10,000 of revenue is $6,000 of gross profit, which may not cover a $7,000 monthly overhead; a 20% margin on $100,000 is $20,000 and covers it easily. Margin percentage without revenue is half a picture.
It also ignores inventory effects. Under absorption costing, unsold inventory holds some fixed cost on the balance sheet, so a month that builds stock can show a better margin than a month that sells it. Cash flow follows the inventory, not the ratio, and a business can look healthy on margin while running short of cash.
One related distinction is easy to blur. Gross margin subtracts all production costs, including factory overhead and direct labor; contribution margin subtracts only the costs that vary with volume. At a 40% gross margin the contribution margin is usually higher, and it is the correct input for a break-even or pricing decision, while gross margin stays the summary line investors read.
Frequently asked questions
How do I calculate gross margin?
Subtract COGS from revenue, divide by revenue, then multiply by 100. At $1,000 of revenue and $600 of COGS, gross profit is $400 and the margin is 40.00%.
What is the difference between gross margin and markup?
Markup is profit divided by cost; margin is profit divided by price. A 50% markup on a $100 item gives a $150 price and a 33.3% margin. Margin is always lower than markup for the same sale.
How do I convert markup to margin?
Divide the markup by 100 plus the markup. A 25% markup is 25 ÷ 125 = 20.0% margin; a 75% markup is 75 ÷ 175 = 42.9%.
How do I convert margin to markup?
Divide the margin by 100 minus the margin. A 40% target margin needs 40 ÷ 60 = 66.7% markup, and a 50% margin needs a 100% markup, which retailers call keystone pricing.
What is a good gross margin?
It depends on the sector. Software often runs 70% to 85%, restaurants 55% to 65%, specialty retail 40% to 55% and grocery 20% to 30%. Compare within your industry and against your own prior periods rather than against a universal target.
What happens to margin if I cut price 10%?
It falls faster than revenue. On the default $1,000 sale with $600 of COGS, a 10% discount drops revenue to $900, gross profit to $300 and margin to 33.3% — a 6.7-point decline for a 10% price cut.
Does gross margin include shipping?
Inbound freight on purchased goods usually belongs in COGS; outbound shipping to customers is often treated as an operating expense. Classifying outbound shipping as COGS typically reduces reported margin by 2 to 4 points for an e-commerce business.
What is the difference between gross and net margin?
Gross margin subtracts only direct production costs. Net margin also subtracts operating expenses, interest and taxes. A 40% gross margin with $9,000 of overhead on $25,000 of revenue leaves a 4% operating margin before tax.
Can gross margin be negative?
Yes, when COGS exceeds revenue. Selling a $600 item for $500 produces a gross margin of −20%, which means every sale loses $100 before any overhead is counted. No volume fixes a negative gross margin.
Why does my margin change when sales grow?
Because fixed production costs get spread over more units, or because the sales mix shifts toward lower-margin products. Either can move a blended margin by several points without any change in the price of an individual item.
Method and sources
- Gross margin: (revenue - COGS) / revenue x 100.
For educational purposes only — not financial, tax, or legal advice. Verify figures with a qualified professional before acting.