How to use the margin calculator
Fill in any two of the five boxes, as long as one of them is the cost or the revenue, and the calculator works out the rest. The boxes it fills in are highlighted. Clear a box to choose which value to solve for.
- 1Find your margin. Enter the cost and the selling price (revenue). You get the gross profit, the gross margin and the markup.
- 2Price for a target margin. Enter the cost and the margin you want, for example 40%. The calculator gives the selling price.
- 3The most you can pay. Enter the selling price and the margin you need. The calculator gives the highest cost that still leaves that margin.
- 4Turn a markup into a margin. Enter the cost and your usual markup to see the selling price and the margin it really gives you.
The formulas
With the default numbers, an item that costs $70 and sells for $100 makes a gross profit of $30. That is a gross margin of 30 ÷ 100 = 30% and a markup of 30 ÷ 70 = 42.86%.
To price for a margin, divide the cost by one minus the margin written as a decimal.
For a 40% margin on an item that costs $45: $45 ÷ 0.6 = $75. The $30 of profit is 40% of the $75 price, and 66.67% of the cost.
Margin versus markup
Margin and markup describe the same profit against different bases: margin against the selling price, markup against the cost. For a sale at a profit, the markup is always the bigger number. Mixing them up overstates profit: adding 30% to the cost gives a margin of only 23.08% (0.3 ÷ 1.3).
Use decimals: 30% is 0.30.
| Gross margin | Markup | Price for a $100 cost |
|---|---|---|
| 10% | 11.11% | $111.11 |
| 20% | 25% | $125 |
| 25% | 33.33% | $133.33 |
| 30% | 42.86% | $142.86 |
| 33.33% | 50% | $150 |
| 40% | 66.67% | $166.67 |
| 50% | 100% | $200 |
| 60% | 150% | $250 |
| 75% | 300% | $400 |
The IRS suggests a related check for small businesses in Publication 334: divide gross profit by net receipts and compare the percentage with your markup policy. A large gap can mean that sales, purchases or inventory were figured wrongly.
Gross, operating and net margin
This calculator gives the gross margin when the cost you enter is the cost of goods sold: what you paid for the goods, or the materials and labor that went into them. In accounting, cost of goods sold is deducted from net sales to find gross margin (gross profit).
Operating margin also subtracts the costs of running the business, such as rent, wages and marketing. Net margin subtracts everything, including interest and taxes. To see a net figure for a period, enter all of your costs as the cost and your total sales as the revenue.
Typical margins by industry
Margins vary widely between industries. Aswath Damodaran of NYU Stern publishes averages for U.S. listed companies every year. These are from his January 2026 data:
| Industry | Gross margin | Net margin |
|---|---|---|
| Software (system and application) | 71.72% | 25.49% |
| Apparel | 56.88% | 3.85% |
| Retail (general) | 33.18% | 5.61% |
| Restaurants and dining | 32.24% | 9.37% |
| Retail (grocery and food) | 26.31% | 1.32% |
| Food processing | 23.23% | 2.82% |
| Trucking | 21.19% | 3.79% |
| Auto and truck makers | 10.41% | 1.29% |
| All U.S. companies (5,994 firms) | 37.76% | 9.74% |
A high gross margin doesn't promise a high net margin. Apparel companies keep about 57% of sales after the cost of their goods, but design, stores and marketing leave them about 4% as net profit.
Frequently asked questions
What is a good profit margin?
It depends on the industry. Across U.S. listed companies in January 2026, the average gross margin was about 38% and the average net margin about 10%, but software companies averaged a gross margin near 72% and grocery retailers about 26%. Compare your margin with businesses like yours.
What's the difference between margin and markup?
Margin divides the profit by the selling price; markup divides it by the cost. Selling something that cost $70 for $100 is a 30% margin and a 42.86% markup.
How do I work out a selling price from the cost and a margin?
Divide the cost by one minus the margin as a decimal. For a 25% margin on a $60 cost: $60 ÷ 0.75 = $80.
Can a margin be more than 100%?
A gross margin can't: 100% would mean the goods cost nothing. Markup has no upper limit. Selling for $300 something that cost $100 is a 200% markup but a 66.67% margin.
What does a negative margin mean?
You sold below cost. Selling for $90 an item that cost $100 is a margin of −11.11%, a loss of $10 on each sale.
Is gross profit the same as gross margin?
Gross profit is the amount of money (revenue minus the cost of goods sold), and gross margin is that amount as a percentage of revenue. Some accounting texts also call the money amount gross margin.
Sources
- 1Publication 334, Tax Guide for Small Business · Internal Revenue Service · Accessed November 2026
- 2Principles of Accounting, Volume 1, 6.1 Compare and Contrast Merchandising versus Service Activities and Transactions · OpenStax, Rice University · Accessed November 2026
- 3Operating and Net Margins by Industry (US), January 2026 · Aswath Damodaran, NYU Stern School of Business · Accessed November 2026