Profit Margin Calculator

Calculate gross margin and markup from cost and revenue — or find the right selling price from a target margin or markup. In results both figures are always shown together so you can see how they relate.

Results Live
Revenue
Cost (COGS)
Gross profit
Gross margin Profit ÷ Revenue
Markup Profit ÷ Cost

What is a profit margin?

Profit margin shows how much of your sales revenue remains as profit after subtracting the cost of the goods or services sold. It is usually expressed as a percentage, making it useful for comparing products, pricing decisions, and business performance.

For example, if you sell a product for $50 and its cost is $30, your gross profit is $20. The gross margin is 40%, meaning $40 of every $100 in revenue remains after the direct cost of the product.

Basic profit margin calculation
Gross profit = Revenue − Cost Profit margin = Gross profit ÷ Revenue × 100   Example: $50 revenue − $30 cost = $20 profit $20 ÷ $50 × 100 = 40% margin

Margin vs markup — what is the difference?

Both margin and markup measure profit on the same transaction. The only difference is the denominator — what you divide by to get the percentage.

  • Gross margin divides profit by revenue. It answers: "what share of each dollar I collect is profit?"
  • Markup divides profit by cost. It answers: "how much did I add on top of what it cost me?"

This single difference produces two completely different numbers from the same transaction — and confusing them is one of the most common pricing mistakes in small business.

The formulas
Gross profit = Revenue − Cost Gross margin = Gross profit ÷ Revenue × 100 Markup      = Gross profit ÷ Cost × 100   Example: Cost $30, Revenue $50 Gross profit = $50 − $30 = $20 Gross margin = $20 ÷ $50 = 40% Markup      = $20 ÷ $30 = 66.7%

Why the same profit gives two different percentages

On that $30 cost / $50 revenue example, the profit is $20 either way. But 40% ≠ 66.7%. The numbers describe the same reality from different vantage points:

  • The seller collected $50 and kept $20 — that is 40% of revenue as profit
  • The seller spent $30 and earned $20 on top — that is 66.7% above cost

Neither is wrong. But using margin language when you mean markup — or quoting a client a "markup" when you're calculating a "margin" — will result in underpricing every time.

How to calculate profit margin from cost and selling price

To calculate gross profit margin, subtract your cost from the selling price to find the gross profit, then divide that profit by the selling price. Multiply by 100 to convert the result to a percentage.

For example, suppose a product costs $40 and sells for $80. The gross profit is $40, so the gross margin is 50%. If the same product is sold for $60, the gross profit falls to $20 and the margin falls to 33.3%.

This is useful when evaluating whether a product's current selling price leaves enough room to cover the rest of the business's expenses.

What costs should you use?

For a basic gross margin calculation, use the direct cost associated with producing or purchasing the product or service. Depending on the business, this can include wholesale purchase cost, raw materials, manufacturing costs, packaging, or other direct production costs.

Gross margin is different from net profit margin. Net margin considers additional expenses such as salaries, rent, software, advertising, insurance, taxes, and other operating costs. A product can therefore have a healthy gross margin while the overall business still has a low or negative net margin.

Converting between margin and markup

Conversion formulas
Margin from Markup = Markup ÷ (1 + Markup) Markup from Margin = Margin ÷ (1 − Margin)   40% markup → 40 ÷ 140 = 28.6% margin 40% margin → 40 ÷ 60  = 66.7% markup

If you are setting a product price from a known cost, you can also use the markup calculator to work directly from the percentage added to cost.

Finding the right selling price

Use the Find selling price tab when you know your cost and want to hit a target. The formulas are different depending on whether your target is a margin or a markup:

From a target margin
Revenue = Cost ÷ (1 − Margin%) Example: Cost $30, target 40% margin → $30 ÷ 0.60 = $50.00
From a target markup
Revenue = Cost × (1 + Markup%) Example: Cost $30, target 40% markup → $30 × 1.40 = $42.00

Same cost, same 40% target — but $50 vs $42. This is why the distinction matters in practice.

Using profit margin when pricing products

A target margin can be useful when setting or reviewing prices because it works backward from the amount of revenue you want to retain. For example, if a product costs $60 and you want a 50% gross margin, the required selling price is $120.

However, a target gross margin should not be treated as the same thing as your final business profit. Discounts, payment processing fees, shipping, advertising, returns, overhead, and taxes can all reduce the amount that ultimately reaches the bottom line.

For businesses that need to understand the sales volume required to cover fixed costs, a break-even calculator can be useful alongside a margin calculation.

Margin and markup reference table

MarkupGross marginOn $100 costRevenue
10%9.1%$100$110.00
20%16.7%$100$120.00
25%20.0%$100$125.00
33.3%25.0%$100$133.33
50%33.3%$100$150.00
66.7%40.0%$100$166.67
100%50.0%$100$200.00
200%66.7%$100$300.00

Frequently asked questions

How do I calculate profit margin?

Subtract the cost from the selling price to find gross profit. Then divide gross profit by the selling price and multiply by 100. For example, a $30 cost and $50 selling price produces a $20 profit and a 40% gross margin.

Is a 40% margin the same as a 40% markup?

No — and this is the most common source of pricing errors. A 40% margin means profit is 40% of revenue, which requires a 66.7% markup on cost. A 40% markup means you added 40% to your cost, giving you a 28.6% margin. Same words, very different numbers.

What is a good profit margin?

It depends entirely on the industry. Grocery retail typically operates at 1–3% net margin. Software companies can exceed 70%. As a rough reference: gross margins below 20% are thin for most product businesses; 40–60% is common in e-commerce; services businesses often run 50–70%. Compare to industry benchmarks rather than a universal standard.

Can margin exceed 100%?

No. Gross margin is profit divided by revenue, and profit can never exceed revenue (that would require negative costs). Margin is bounded at 0–100%. Markup, however, has no ceiling — a 200% markup simply means you charged three times your cost.

What happens when revenue is below cost?

Both margin and markup become negative, indicating a loss. This is mathematically valid — many businesses sell below cost during promotions or when clearing inventory. The calculator handles this correctly and flags it as a loss.

Disclaimer: For educational and planning purposes only. Gross margin does not account for operating expenses, taxes, or other costs. Consult an accountant for business financial decisions.