Skip to content

Margin Calculator

Gross margin from cost and price, or the price that hits a target margin.

I know
Profit margin
40%
Profit per sale
40.00
Selling price
100.00
Markup on cost
66.67%Same profit, measured against cost
  1. Profit100.00 − 60.00= 40.00
  2. Margin (profit ÷ price)40.00 ÷ 100.00= 40%
  3. Markup (profit ÷ cost)40.00 ÷ 60.00= 66.67%
Formula
margin = (price − cost) ÷ price
price for a target margin = cost ÷ (1 − margin)
markup = margin ÷ (1 − margin)
The link fills in these numbers for whoever opens it.

Your numbers are worked out in this tab and aren’t sent to our servers.

Comparing two prices as a percent change? Use the Percentage Calculator on browserutils

How to use Margin Calculator

  1. Choose "Cost and price" to find the margin you make, or "Cost and the margin I want" to find the price to charge.
  2. Enter the cost of one unit: what you paid the supplier, or materials and direct labour.
  3. Enter the selling price before sales tax or VAT, or the target margin.
  4. Read the margin, the profit per sale and the same profit expressed as a markup on cost.
  5. Open the working to see each division, and copy the link to share the price with a colleague.

Margin Calculator formula

margin = (price − cost) ÷ price
price for a target margin = cost ÷ (1 − margin)
markup = margin ÷ (1 − margin)

Features

  • Both directions: margin from a price, and price from a target margin using price = cost ÷ (1 − margin).
  • Shows the matching markup next to every margin, so you can talk to suppliers who quote in markup.
  • Warns when the price is below cost and shows the loss per sale.
  • Caps a target margin below 100%, where the price formula would divide by zero.
  • Every result has the arithmetic written out with your numbers.

About Margin Calculator

Gross profit margin is profit as a share of the selling price: margin = (price − cost) ÷ price. A product that costs 60 and sells for 100 makes 40 profit and a 40% margin. Margin can never reach 100% unless the cost is zero, and it’s the number accountants, investors and most pricing benchmarks use, because it shows how much of each sale you keep.

To price for a margin, divide the cost by one minus the margin. For a 40% margin on a 60 cost, 60 ÷ 0.6 = 100. A common mistake is to add 40% to the cost (60 × 1.4 = 84), which is a 40% markup and only a 28.6% margin. The markup calculator covers that direction and has a conversion table.

This is gross margin on a single unit: it doesn’t include overheads such as rent, salaries or marketing, which are what net margin subtracts. Enter prices without sales tax or VAT; if your prices include VAT, take it out with the VAT calculator first, or your margin will look bigger than it is.

Margin Calculator specs

Runs
In this browser tab
Built on
Plain JavaScript arithmetic in the page; money is rounded to the cent only where the steps say so
Cost
Free, no account needed
Browsers
Current Chrome, Edge, Firefox and Safari
Last updated
November 27, 2026
Part of
18 free tools on calcutils.dev

Questions

How do I calculate profit margin?
Subtract the cost from the price, divide by the price and multiply by 100. Price 50, cost 30: (50 − 30) ÷ 50 = 40%.
How do I find the price for a target margin?
Divide the cost by (1 − margin). For a 35% margin on a cost of 13, the price is 13 ÷ 0.65 = 20.
Is margin the same as markup?
No. They measure the same profit against different bases. Margin divides it by the price, markup by the cost. A 40% margin is a 66.7% markup, and a 50% markup is a 33.3% margin.
What is a good profit margin?
It depends on the industry. Grocery and fuel retail often run on gross margins under 30%, many retailers and restaurants aim for 30% to 70% on what they sell, and software companies often report gross margins above 70%. Compare with businesses like yours, not with an overall average.
What is the difference between gross and net margin?
Gross margin subtracts only the direct cost of what you sold. Net margin also subtracts overheads, interest and tax. This calculator gives gross margin per unit.

More in Business

All 3 in Business