Margin Calculator

Calculate gross profit and profit margin instantly from cost and selling price. Enter your numbers to find the markup, margin percentage, and the selling price for a target margin with this free calculator.

How to Use

  1. Enter cost

    Input the cost of your product or service.

  2. Enter selling price or margin

    Input either the selling price or your desired margin percentage.

  3. View results

    See profit margin, markup percentage, and profit amount.

What is profit margin?

Profit margin (gross margin) is the share of the selling price (revenue) that remains as profit after subtracting cost, expressed as a percentage. Earning the same $100 means very different things depending on the price you sold at, so margin — rather than the absolute profit figure — is the standard for comparing profitability.

Why it matters

  • Pricing: Setting a target margin lets you price consistently even when costs change.
  • Comparing profitability: It puts products, stores, and time periods of different sizes on the same yardstick.
  • Profit-and-loss management: If margin falls below your fixed-cost ratio, you lose money on every sale, so it helps decide whether a business is worth continuing.

By definition margin can never exceed 100%, and it approaches 100% as cost nears zero. The often-confused markup divides the same profit by cost instead of by selling price, so it always comes out higher than margin.

The formula

This calculator derives three values from the selling price (revenue) and the cost.

Net profit = Revenue − Cost
Margin (%) = (Revenue − Cost) / Revenue × 100
Markup (%) = (Revenue − Cost) / Cost × 100

Example: at a selling price of $100 and a cost of $60, net profit is 100 − 60 = $40, the margin is 40 / 100 × 100 = 40%, and the markup is 40 / 60 × 100 ≈ 66.7%. If revenue is 0, the margin is treated as 0.

Frequently Asked Questions

What is profit margin?
Profit margin is the profit (selling price minus cost) divided by the selling price. At a selling price of $100 and a cost of $70, the margin is 30%.
What is the formula for margin?
Margin (%) = (Revenue − Cost) / Revenue × 100. For example, with revenue of $100 and cost of $60, the margin is 40%.
What is the difference between margin and markup?
Margin divides profit by the selling price, while markup divides profit by the cost. Because the denominators differ, markup is always higher than margin for the same transaction.
What markup does a 40% margin equal?
Convert with Markup = Margin / (100 − Margin) × 100. A 40% margin equals 40 / 60 × 100 ≈ 66.7% markup.
What is a good profit margin?
It varies by industry. Retail is typically 20-50%, restaurants 60-70%, and software 70-90%. You should also weigh the competitive landscape and your fixed-cost structure.
What selling price hits my target margin?
Selling price = Cost / (1 − target margin). With a cost of $60 and a target margin of 40%, set the price at 60 / (1 − 0.4) = $100.
Can margin exceed 100%?
No. Margin is profit divided by revenue, so even at zero cost it tops out at 100% and can never exceed revenue. Figures above 100% are markup.
Is the margin here the same as operating margin?
No. This calculator shows gross margin, based only on selling price and purchase cost. Once you subtract selling and administrative expenses such as wages, rent, and marketing, operating margin comes out lower.
Updated 2026 — latest rates

Related Calculators