Margin Calculator

This free margin calculator finds your gross profit margin in seconds. Enter what an item costs you and what you sell it for to get the margin, the profit and the equivalent markup, with the working shown. Switch modes to find the most you can pay for a target margin, or the price you need to charge. Everything is calculated in your browser.

Calculate Margin

📐 Margin Formula

Margin % = ((Selling - Cost) / Selling) × 100

Selling = Cost / (1 - Margin%)

Cost = Selling × (1 - Margin%)

Results

Gross Margin

33.33%

Cost Price$100.00
Selling Price$150.00

Profit

$50.00

Margin vs Markup

Margin

33.33%

of selling price

Markup

50.00%

of cost price

Calculation:

Profit = $150.00 - $100.00 = $50.00

Margin = $50.00 / $150.00 × 100 = 33.33%

Margin ↔ Markup Conversion

MarginMarkupExample (selling price 100)
10%11.11%$90.00 cost → $100.00 selling price
20%25.00%$80.00 cost → $100.00 selling price
25%33.33%$75.00 cost → $100.00 selling price
30%42.86%$70.00 cost → $100.00 selling price
40%66.67%$60.00 cost → $100.00 selling price
50%100.00%$50.00 cost → $100.00 selling price
60%150.00%$40.00 cost → $100.00 selling price
75%300.00%$25.00 cost → $100.00 selling price

Summary: Calculate Profit Margin Free, Without Uploading Prices

Gross profit margin is the share of the selling price that is profit: margin % = (selling price − cost) ÷ selling price × 100. This margin calculator applies that formula to a cost and a selling price, and it also works backward from a target margin to the price you should charge or the most you can pay. Every result shows the profit, the equivalent markup and the working, so you can check it.

It runs in your browser and nothing is uploaded; the Network tab in DevTools shows no request carrying your prices. It measures gross margin only, so shipping, overheads, tax and fees are not deducted.

The formulas it uses

  • Margin % = (Selling − Cost) ÷ Selling × 100, and Markup % = (Selling − Cost) ÷ Cost × 100.
  • Target Price mode: Selling = Cost ÷ (1 − Margin%).
  • Find Cost mode: Cost = Selling × (1 − Margin%).
  • Equivalent markup for a margin m: m ÷ (100 − m) × 100.

Margin and markup start from the same profit but divide by different prices, so a 40% margin is a 66.67% markup. The table under the calculator lists that conversion for margins from 10% to 75%. For pricing that starts from a markup instead, use the markup calculator.

Table of Use: Margin Calculator Examples

ModeWhat you enterWhat you get
CalculateCost 100, selling price 150Gross Margin 33.33%; profit $50.00; markup 50.00%
CalculateCost 90, selling price 150Gross Margin 40.00%; profit $60.00; markup 66.67%
Target PriceCost 60, Target Margin 40%Required Selling Price $100.00; profit $40.00; markup 66.67%
Target PriceCost 100, Target Margin 30%Required Selling Price $142.86; profit $42.86
Find CostSelling price 100, Target Margin 35%Maximum Cost Price $65.00; profit $35.00; markup 53.85%
Calculate (loss)Cost 120, selling price 100Margin −20.00%; Loss −$20.00; markup −16.67%

Features

  • Three modes: Calculate (find margin), Find Cost (from a margin) and Target Price (for a margin).
  • Margin vs Markup panel and a Calculation box that writes out the formula with your numbers.
  • Margin presets of 20%, 30%, 40%, 50% and 60%, plus copy buttons for the margin, the maximum cost and the required price.
  • Currency symbol choice (USD, EUR, GBP, INR, JPY, AUD, CAD or none); it changes the label only and does not convert amounts.
  • Flexible input: prices and margins accept up to four decimals, and commas or spaces typed into a price are ignored.
  • Edge cases handled: a margin of 100% or more is rejected, a price below cost is shown as a loss, and markup shows a dash when the cost is zero.

How to Use the Margin Calculator

  1. Pick a Currency symbol, or No symbol.
  2. Choose a mode: Calculate, Find Cost or Target Price.
  3. Enter the Cost Price and Selling Price that the mode asks for.
  4. In the two target modes, type a Target Margin (%) or tap a preset.
  5. Read the result, check the Calculation box, and use the copy icon to take the number with you.

Who Can Use It

Shop owners and online sellers can set prices that protect a margin, buyers can learn the most they can pay a supplier, and restaurant or service businesses can test a price against the cost of delivering it. Students of accounting can use the working box to see each step.

Pair it with the discount calculator to see how a sale price changes your margin, the percentage calculator for quick percent changes, and the GST calculator or VAT calculator to add or remove sales tax from a price. If you take profit as personal income, the income tax calculator gives a rough tax estimate, though it leaves out social-security and national-insurance contributions. If a supplier quotes in another currency, convert it first with the currency converter, and to see what profits could earn when invested, try the investment calculator.

FAQs

How do I calculate profit margin?

Gross margin = (selling price − cost) ÷ selling price × 100. For a 150 selling price and a 90 cost, (150 − 90) ÷ 150 × 100 = 40%. The 60 profit is 40% of the 150 selling price. Enter the two prices in Calculate mode and the calculator shows the margin, the profit and the working.

What is the difference between margin and markup?

Both use the same profit, but margin divides it by the selling price while markup divides it by the cost. Buying at 60 and selling at 100 is a 40% margin but a 66.67% markup. Margin can never reach 100% unless the cost is zero; markup can be any size.

How do I convert margin to markup?

Markup = margin ÷ (1 − margin), using decimals. A 40% margin gives 0.40 ÷ 0.60 = 0.6667, a 66.67% markup. To go the other way, margin = markup ÷ (1 + markup), so a 50% markup is a 33.33% margin. The calculator shows both numbers for every result.

What selling price do I need for a target margin?

Selling price = cost ÷ (1 − target margin). A cost of 100 and a 30% target margin need 100 ÷ 0.70 = 142.86. Adding 30% to the cost gives only 130, which is a 23.08% margin, a common pricing mistake. Use Target Price mode for the exact figure.

What is a good profit margin?

It depends heavily on the industry. In Aswath Damodaran’s January 2026 dataset of US-listed companies (NYU Stern), average gross margins were about 26% for grocery and food retail, 72% for system and application software and 38% for the whole market. Compare yourself with your own industry, not an overall average.

Can profit margin be negative or above 100%?

It can be negative but never above 100%. Selling below cost gives a negative margin and the calculator labels it a loss, for example −20.00% on a cost of 120 and a price of 100. Margin reaches 100% only when the cost is zero. Markup, in contrast, can exceed 100%: a 200% markup means selling at three times cost.

Is it safe to enter my product costs into this margin calculator?

Yes. The calculation runs in your browser and nothing is uploaded. Open the Network tab in DevTools while you type to confirm that no request carries your prices. The calculator does not save your numbers; the copy buttons write only to your own clipboard.