Enter revenue and costs to calculate gross, operating and net profit margin, plus markup, or find the selling price that hits a target margin. The formulas and a worked example are below the calculator.
The calculator above takes four lines from a profit and loss statement and returns the margin at each level. The lower panel works the other way: from a unit cost and the margin you want, it gives the selling price.
Gross margin = (Revenue − Cost of goods sold) / Revenue
Operating margin = Operating profit / Revenue
Net margin = Net income / Revenue
Each level takes off one more layer of cost. Gross margin removes only the cost of what was sold. Operating margin also removes the cost of running the business: selling, general and administrative expenses, research and development, depreciation. Net margin removes interest and income tax as well, leaving what belongs to the owners.
The denominator is always the same: revenue. That is what makes the three comparable and what separates a margin from a markup.
In Excel, with revenue in B2 and cost of goods sold in B3:
=(B2-B3)/B2
Format the cell as a percentage.
| Input | Where it comes from |
|---|---|
| Revenue | Net sales: invoiced revenue after discounts, rebates and credit memos |
| Cost of goods sold | The cost of the products or services sold in the same period |
| Operating expenses | Selling, general and administrative, R&D, depreciation and amortization |
| Interest and taxes | Interest expense and income tax expense |
US GAAP does not define an "operating profit" subtotal: the SEC's Regulation S-X, Rule 5-03 sets out the income statement captions (net sales, costs applicable to sales, other operating costs, income before income taxes), and most companies present operating income from those. Treat operating margin as a management measure and write down which lines it includes. IFRS reporters get a defined operating profit subtotal under IFRS 18, for annual periods beginning on or after January 1, 2027.
One distributor, one fiscal year, in USD. These are the numbers the calculator opens with.
| Line | Amount | Margin |
|---|---|---|
| Revenue | 2,400,000 | |
| Cost of goods sold | 1,560,000 | |
| Gross profit | 840,000 | 35.0% |
| Operating expenses | 552,000 | |
| Operating profit | 288,000 | 12.0% |
| Interest expense | 36,000 | |
| Income before taxes | 252,000 | 10.5% |
| Income tax at 25% | 63,000 | |
| Net income | 189,000 | 7.9% |
The 25% tax rate is an assumption: the 21% federal corporate rate plus state income tax, blended. Net margin is 189,000 / 2,400,000 = 7.875%, shown as 7.9%.
The same 840,000 of gross profit is a 35.0% margin on revenue and a 53.8% markup on cost (840,000 / 1,560,000). Margin can never reach 100%; markup can.
To price for a target margin, divide the cost by one minus the margin:
Price = Cost / (1 − target margin)
A unit costing 65.00 at a 35% target margin must sell at 65 / 0.65 = 100.00. Price the same unit at a 35% markup instead and it sells at 87.75 and earns a 25.9% margin (22.75 / 87.75): nine points less than intended. The lower panel of the calculator shows both, and converts the margin back from the markup as a check.
Add the profit at each level back to the costs taken off and you return to revenue:
And the margins fall in order: net (7.9%) below operating (12.0%) below gross (35.0%). If net margin comes out above operating margin, the P&L has non-operating income in it, such as a gain on an asset sale, and the net figure is not a reading of trading performance.
For what counts as good, compare against peers in the same industry: Aswath Damodaran's margins by industry for US companies are updated every January. For the difference between gross, contribution and net margin, see gross margin vs contribution margin vs net margin, and the short definition of gross margin.
One company margin hides a spread. A 35% gross margin can be 48% on half the revenue and 22% on the other half, and the large accounts are often the thin ones once their realized price replaces list price. The calculator works on one set of totals. Covirage computes the same margins for every customer and product line in an uploaded ledger, with deterministic tools doing the arithmetic and the external AI model only explaining which accounts pull the average down. See customer profitability, or margin by account for the method.
It depends on the industry. Distributors often run gross margins in the teens to twenties and net margins of a few percent; software companies run gross margins above 70%. Compare against your own history and against peers in the same industry, not a universal number.
Profit percentage on selling price is (selling price - cost) / selling price. On cost price it is (selling price - cost) / cost, which is markup. A unit bought at 65 and sold at 100 has a 35% margin and a 53.8% markup.
No. Both use the same profit, but margin divides by the selling price and markup divides by cost. Margin can never reach 100%; markup can exceed it. Confusing the two is the most common pricing error in quoting.
Gross margin tells you whether pricing covers the product cost, operating margin whether the business covers its running costs, and net margin what is left for owners. Management usually steers on gross and operating margin because net margin mixes in financing and tax.