Sign in

Tools

Profit margin calculator: gross, operating and net margin from one P&L

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 short answerProfit margin is profit divided by revenue, shown as a percentage. Gross margin = (revenue - cost of goods sold) / revenue. Operating margin = operating profit / revenue. Net margin = net profit / revenue. On revenue of 2,400,000 and cost of goods sold of 1,560,000, gross margin is 35%. To price for a target margin, divide cost by (1 - margin).

Margins from your P&L

Net of discounts and returns
SG&A, R&D, depreciation
Gross margin35.0%Gross profit $840,000
Operating margin12.0%Operating profit $288,000
Net margin7.9%Net profit $189,000
Markup on cost53.8%Gross profit ÷ COGS

Price for a target margin

A share of the selling price
Selling price$100.00Cost ÷ (1 − margin)
Markup on cost53.8%Margin ÷ (1 − margin)
Profit per unit$35Price − cost
Check35.0%Margin back from markup

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.

The three margin formulas

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.

The P&L lines you need

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.

A worked example on one year's P&L

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%.

Margin versus markup

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.

The check that proves it

Add the profit at each level back to the costs taken off and you return to revenue:

  • 840,000 + 1,560,000 = 2,400,000
  • 288,000 + 552,000 + 1,560,000 = 2,400,000
  • 189,000 + 63,000 + 36,000 + 552,000 + 1,560,000 = 2,400,000

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.

Where it goes wrong

  • Dividing by cost instead of revenue. That is markup, and it overstates margin: 53.8% instead of 35%.
  • Gross invoiced revenue. Using revenue before discounts, rebates and credit memos inflates both revenue and margin.
  • Averaging percentages. The margin of a group is total profit over total revenue, never the average of product or customer margins.
  • Mixed periods. A year of revenue against eleven months of costs, or accrual costs against cash receipts, gives a margin that belongs to no period.
  • One-time items. A net margin that includes a property sale or a tax credit is not a trading margin.

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.

Margin per customer, not only per company

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.

Questions people ask

What is a good profit margin?

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.

How do I calculate profit percentage from cost price and selling price?

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.

Is profit margin the same as 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.

Which profit margin matters most?

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.