Skip to content

Tool 11 of 22

Profit margin calculator.

Find gross margin %, markup, and gross profit. Switch modes to solve for revenue, cost, or margin.

What is profit margin?

Profit margin (also called gross margin) is the percentage of revenue that remains after subtracting the cost of goods sold. It tells you how efficiently a business converts sales into profit. A 40% gross margin means that for every $1 of revenue, $0.40 is profit and $0.60 covers costs.

The core formula is: Gross Margin % = (Revenue − Cost) ÷ Revenue × 100. This calculator solves all three directions — give it any two of Revenue, Cost, and Margin % and it calculates the third instantly.

Margin vs. markup — what's the difference?

Margin and markup both measure profitability on the same product, but they use a different denominator. Margin divides profit by revenue; markup divides profit by cost. Because cost is always less than revenue (for a profitable product), markup is always a higher percentage than margin.

Example: Cost = $60, Selling price = $100, Profit = $40

Margin = $40 ÷ $100 × 100 = 40%

Markup = $40 ÷ $60 × 100 = 66.67%

How to find selling price from cost and target margin

A common pricing question is: "My cost is $X and I want a Y% margin — what should I charge?" The formula is:

Selling Price = Cost ÷ (1 − Margin% ÷ 100)

For a $50 cost with a 40% target margin: $50 ÷ (1 − 0.40) = $50 ÷ 0.60 = $83.33. Switch to the "Cost + Margin %" tab above to calculate this in one step.

Typical profit margins by industry

Industry Typical gross margin
Software / SaaS 60–80%
Pharmaceuticals 55–75%
Professional services 25–40%
Food & beverage manufacturing 20–35%
Retail (general) 20–35%
Grocery / supermarkets 25–30%
Restaurants 60–70% (food cost ~30–40%)
Construction 15–25%
eCommerce 10–30%

How to calculate profit margin

Profit margin measures how much of every dollar in revenue a business keeps as profit. It's one of the most fundamental metrics in business and finance — used by entrepreneurs to set prices, investors to evaluate companies, and managers to benchmark performance against competitors.

The profit margin formula

Gross Margin % = ((Revenue − Cost) ÷ Revenue) × 100
Markup % = ((Revenue − Cost) ÷ Cost) × 100

Both formulas measure the same profit — but from different angles. Margin expresses profit as a fraction of the selling price. Markup expresses it as a fraction of the cost. A product that costs $60 and sells for $100 has a 40% margin but a 66.67% markup.

Worked examples

  • Retail product: Cost $45, sells for $80. Margin = ($80 − $45) ÷ $80 × 100 = 43.75%. Markup = $35 ÷ $45 × 100 = 77.78%.
  • Freelance service: You charge $5,000 for a project that costs you $2,000 in time and expenses. Margin = 60%. Markup = 150%.
  • Restaurant meal: Food cost $4, menu price $15. Margin = 73.3%. Typical for restaurants, where food cost is low but labor and overhead eat into net profit.

Setting prices from a target margin

If you know your cost and want to achieve a specific margin, use this formula:

Selling Price = Cost ÷ (1 − Target Margin% ÷ 100)

Example: your product costs $30 and you want a 40% margin. Price = $30 ÷ 0.60 = $50. At $50, your profit is $20, which is 40% of revenue.

Typical gross margins by industry

  • SaaS / Software: 60–80%. Low marginal cost per customer once the product is built.
  • Pharmaceuticals: 55–75%. High R&D costs are offset by strong per-unit margins.
  • Professional services: 25–40%. Labor is the primary cost.
  • Retail (general): 20–35%. Competitive pricing and high inventory costs compress margins.
  • Grocery: 1–3%. Razor-thin margins, high volume.

Margin vs. markup — why the distinction matters

A common pricing mistake is confusing margin and markup. If you want a 50% margin and add a 50% markup to your $100 cost, you'd price at $150 — but your actual margin is only 33.3% ($50 ÷ $150). To achieve a true 50% margin, you need a 100% markup: $100 × 2 = $200, giving $100 profit on $200 revenue = 50% margin.

Frequently asked questions.

What is profit margin?

Profit margin (also called gross margin) is the percentage of revenue that remains as profit after subtracting the cost of goods sold. Formula: Margin % = (Revenue − Cost) ÷ Revenue × 100. A 40% margin means 40 cents of every dollar earned is profit.

What is the difference between gross margin and net margin?

Gross margin only subtracts the direct cost of goods sold (COGS) from revenue. Net margin subtracts all expenses — including operating costs, interest, and taxes — and is therefore always lower. This calculator computes gross margin.

What is the difference between margin and markup?

Margin is profit as a percentage of revenue (selling price). Markup is profit as a percentage of cost. A product that costs $60 and sells for $100 has a 40% margin but a 66.67% markup. They measure the same profit from different reference points — margin is how much you keep; markup is how much you add.

What is a good gross profit margin?

It depends on your industry. Typical gross margins: SaaS/software 60–80%, pharmaceuticals 55–75%, professional services 25–40%, retail (general) 20–35%, eCommerce 10–30%, construction 15–25%. Note that gross margin is not the same as net profit margin — after subtracting operating costs, salaries, and taxes, net margins are much lower.

How do I find the selling price from cost and target margin?

Use the formula: Selling Price = Cost ÷ (1 − Margin% ÷ 100). For a $50 cost with a 40% target margin: $50 ÷ (1 − 0.40) = $50 ÷ 0.60 = $83.33. Use the "Cost + Margin %" tab in this calculator to do this instantly.

Can profit margin be negative?

Yes. A negative margin means you are selling below cost — spending more than you earn. This is common during early-stage growth phases but is unsustainable long-term.

Is a 50% profit margin good?

A 50% gross margin is excellent in most industries. It means half of every dollar of revenue is profit before operating expenses. Industries like software and pharmaceuticals routinely achieve this; physical retail rarely does.

Related calculators.