All calculators

Money

Margin Calculator

Pick a mode, enter your cost and revenue (or a target margin), and the calculator returns the profit, the margin percentage, and the markup for comparison. The multi-tier mode also splits a P and L into gross, operating, and net margins.

Mode

$

Cost of goods sold for this sale. · e.g. 50

$

What the customer pays. · e.g. 80

Margin from cost and revenue

Profit margin

37.5%

Profit $30.00 · markup 60%

Cost$50.00
Revenue$80.00
Profit$30.00
Margin (profit / revenue)37.5%
Markup (profit / cost)60%
Was this helpful?

Examples

Mode 1 · $50 cost, $80 revenue

Profit $30 · margin 37.5% · markup 60%

Mode 2 · $50 cost, 40% target margin

Selling price ≈ $83.33 · profit ≈ $33.33 · markup ≈ 66.67%

Mode 3 · $100 revenue, 40% margin

Maximum cost $60 · profit $40 · markup 66.67%

Mode 4 · $1,000 rev / $400 COGS / $200 opex / $100 other

Gross 60% · operating 40% · net 30%

How it works

All four modes share the same simple identity: profit equals revenue minus cost, margin is profit divided by revenue, markup is profit divided by cost. The differences between modes are which numbers you start with.

Profit

profit = revenue − cost

Margin

margin % = profit ÷ revenue × 100

Markup

markup % = profit ÷ cost × 100

Selling price from a target margin

selling price = cost ÷ (1 − margin)

Maximum cost from a target margin

cost = revenue × (1 − margin)

Gross / operating / net margin

  • gross profit = revenue − COGS
  • operating profit = gross profit − operating expenses
  • net profit = operating profit − other expenses and taxes
  • each margin = corresponding profit ÷ revenue × 100

What the calculator does

The margin calculator answers the four most common margin questions in one place: what margin a sale produces, what selling price a target margin requires, what cost ceiling a target margin allows, and how a single revenue line splits into gross, operating, and net margin once you account for cost of goods sold, operating expenses, and other costs.

Cost and revenue to margin

Mode 1 takes the cost of a sale and the revenue (or selling price) and returns the dollar profit, the margin percent, and the markup percent. This is the most common margin question. If revenue is below cost, the profit is negative and the margin is reported as negative; the calculator labels the result so the loss is clear.

Cost and target margin to selling price

Mode 2 starts from cost and the margin you want, and returns the selling price that produces it. The formula is selling price = cost ÷ (1 − margin). The calculator also reports the implied markup. A target margin of 100% is impossible at any positive cost; the calculator flags values at or above 100% with a clear validation message.

Revenue and margin to cost

Mode 3 starts from revenue and a target margin and returns the maximum cost that fits the target. The formula is cost = revenue × (1 − margin). Useful when you know what the market will pay and need to back into the cost ceiling.

Gross, operating, and net margin

Mode 4 takes revenue and three expense buckets (cost of goods sold, operating expenses, other expenses and taxes) and returns gross profit, operating profit, and net profit along with the three corresponding margin percentages. The result panel reports net margin as the headline number, with gross and operating shown alongside for context.

Gross margin says how much each dollar of revenue is left after paying for the product. Operating margin says how much is left after running the business. Net margin says how much is actually left over after everything.

Margin vs markup

Margin and markup describe the same dollar profit with different denominators:

  • Margin = profit ÷ revenue. It tells you what share of the selling price is profit.
  • Markup = profit ÷ cost. It tells you what share of the cost was added on to get the selling price.

A $30 profit on a $50 cost and an $80 sale is a 37.5% margin and a 60% markup. The two numbers describe the same sale. Margin is usually the more honest comparison across businesses; markup is how most retailers actually price at the register. The markup calculator flips the framing if you want to enter markup first.

Conversion between the two: markup = margin ÷ (1 − margin), and margin = markup ÷ (1 + markup). A 40% margin is a 66.67% markup; a 100% markup is a 50% margin.

Worked examples

  • Mode 1: cost $50, revenue $80. Profit $30, margin 37.5%, markup 60%.
  • Mode 2: cost $50, target margin 40%. Selling price ≈ $83.33, profit ≈ $33.33, markup ≈ 66.67%.
  • Mode 3: revenue $100, margin 40%. Maximum cost $60, profit $40, markup 66.67%.
  • Mode 4: revenue $1,000, COGS $400, opex $200, other $100. Gross 60%, operating 40%, net 30%.

Common mistakes

  • Confusing margin with markup. They use different denominators (revenue vs cost). A 40% margin is a 66.67% markup, not 40%.
  • Comparing your gross margin to a competitor's net margin. Make sure you are comparing the same tier.
  • Excluding fees, shipping, packaging, or returns from cost. The margin you compute is only as honest as the cost number you feed in.
  • Targeting a margin above 100%. Mathematically impossible at any positive cost. Use markup if you want growth ratios above 100%.
  • Forgetting that operating expenses scale with volume differently than COGS. Margins computed from a single sale may look different from period-level margins.

Related tools

Note. The calculator uses standard margin formulas. Real-world accounting can split costs and expenses many different ways, so the gross / operating / net split depends entirely on how you allocate them in the input fields. It is not accounting or tax advice.

Frequently asked questions

Profit margin is profit expressed as a percent of revenue. The formula is margin = profit ÷ revenue × 100. A $30 profit on $100 of revenue is a 30% margin. Margin compares the profit on a sale to the size of the sale.

Margin is profit divided by revenue (the selling price). Markup is profit divided by cost. The same $30 profit on a $50 cost / $80 sale is a 60% markup and a 37.5% margin. Both describe the same dollar profit; they pick different denominators. Margin is usually the more honest comparison across businesses; markup is how most retailers actually price.

Use the formula selling price = cost ÷ (1 − margin), where margin is in decimal form. For example, a $50 cost at a 40% target margin is 50 ÷ 0.60 ≈ $83.33. Mode 2 of the calculator does this in one step and also reports the implied markup.

Use cost = revenue × (1 − margin), where margin is in decimal form. For example, a $100 revenue at a 40% target margin allows up to $60 of cost. Mode 3 runs this in one step.

Gross margin is gross profit divided by revenue, where gross profit is revenue minus cost of goods sold (COGS). It measures how much of each dollar of revenue is left after paying for the product itself, before operating expenses, interest, and taxes.

Operating margin is operating profit divided by revenue. Operating profit is gross profit minus operating expenses such as salaries, rent, and marketing. It captures how profitable the core business is before financing and tax effects.

Net margin is net profit divided by revenue. Net profit subtracts everything (cost of goods sold, operating expenses, interest, taxes, one-off costs) from revenue. It is the bottom-line profitability percentage.

Yes. If profit is negative (you sold the product for less than it cost, or your expenses exceed revenue), margin is negative too. The calculator shows the loss explicitly and labels the result.

Not in this framing. Margin is profit ÷ revenue, and profit can be at most equal to revenue (cost = 0). That gives a 100% margin. Anything over 100% would mean profit exceeded revenue, which is not possible from a single sale. Markup, by contrast, can be over 100% (and often is).

Whatever you define as cost is what flows through. The calculator does not assume anything about how you build up cost; if you include shipping, packaging, payment fees, and similar in cost, the resulting margin will reflect that. For multi-line gross / operating / net, use cost of goods sold for the gross line and put other costs into operating expenses or other expenses.