Use this free profit margin calculator to find your gross profit margin, profit and markup from a cost and a selling price, to work out the selling price you need for a target margin or markup, to find the cost from a price and a margin, or to take revenue down to gross, operating and net margin. Tables show the price for common margins and markups, how to turn a markup into a margin and back, and the formulas for gross, operating and net margin. It is free and instant, and your numbers stay in your browser.
How to calculate profit margin
Profit margin tells you how much of each sale you keep as profit. Take the selling price, subtract what the product costs you, and divide the result by the selling price. Multiply by 100 to get a percentage. This is the gross profit margin, because it only looks at the cost of the product itself and not at running costs such as rent, wages or tax.
profit = 100 − 60 = 40margin = 40 ÷ 100 = 40%Margin and markup are not the same
Margin is profit as a share of the selling price. Markup is profit as a share of the cost. The same product has both, and the markup is the bigger number. The product above has a 40% margin and a 66.67% markup (40 ÷ 60). A product that costs 75 and sells for 100 has a 25% margin but a 33.33% markup. Mixing the two up is a common pricing mistake: adding 25% to a cost does not give a 25% margin. Some sites call the markup the “profit percentage”, so check which one a number means.
- Margin = (price − cost) ÷ price
- Markup = (price − cost) ÷ cost
- Margin from markup = markup ÷ (1 + markup), and markup from margin = margin ÷ (1 − margin)
How to find the selling price for a target margin
Use the Selling Price tab when you know the cost and the profit you want. For a margin of 40% on a cost of 60, the price is the cost divided by (1 − 0.40), which is 100. For a markup of 50% on the same cost, the price is 60 × 1.50 = 90, and the margin on that sale is 33.33%. The tables under the calculator list the price for common margins and markups.
cost ÷ (1 − margin)Price from markup:
cost × (1 + markup)Cost from price and margin:
price × (1 − margin)Gross, operating and net profit margin
Gross margin takes off only the cost of goods sold (COGS), the direct cost of what you sell. Operating margin also takes off operating expenses such as rent and wages. Net margin takes off interest and taxes as well, so it shows what is left for the owners. The Gross to Net tab works all three out from your revenue.
gross profit = 300,000, so the gross margin is 60%operating profit = 150,000, so the operating margin is 30%net profit = 110,000, so the net margin is 22%What is a good profit margin?
It depends on the industry and on the kind of margin. A shop that sells many items cheaply and a software company have very different margins, so compare yours with similar businesses rather than with one number. Remember that net profit, after all costs, is lower than the gross margin this calculator shows first.
How to improve your profit margin
There are two main levers: raise the price, or lower the cost. Check your prices against your costs often, look for cheaper suppliers or less waste, drop products that earn little, and sell more of the ones with the best margin. Use the Selling Price tab to see what a price change does to your margin before you make it.
Profit margin in Excel and Google Sheets
If the cost is in cell A2 and the price is in B2, the margin is =(B2-A2)/B2 and the markup is =(B2-A2)/A2. Format the cells as percentages. The price for a 40% margin on a cost in A2 is =A2/(1-0.4).
Contribution margin
Contribution margin is the sales of a product minus its variable costs, the costs that change with how many you make or sell. It shows how much each sale adds towards paying your fixed costs and then profit. To find how many sales you need to cover your fixed costs, use the Break-Even Calculator.
Calculators that go with this one
To work out a sale price after a discount, use the Discount Calculator. To add tax to a price, use the Sales Tax Calculator or the VAT Calculator, and for percentages in general use the Percentage Calculator.

