How to Calculate Profit Margin and Markup

Learn gross profit margin vs markup, convert between them, price from cost, and use clear formulas with examples — free online calculator.

By Generatr Team

Profit margin and markup both describe how much you earn above cost — but they use different bases. Margin is profit divided by selling price (revenue). Markup is profit divided by cost. Confusing the two is one of the fastest ways to underprice a product or misread a P&L.

This guide walks through gross profit, margin vs markup formulas, converting one to the other, and setting a price when you know cost and target margin. When you want the numbers done in one pass, open the free margin calculator with cost, price, or either percentage.

You’ll work with dollar examples you can reuse for retail, services, and simple product pricing. For pure percent-of-a-number steps, pair this with the free percentage calculator and our percentage guide.

Free tool

Use the Margin Calculator now

Open the interactive margin calculator in your browser — free, instant, no signup.

Open Margin Calculator

What Is Gross Profit?

Gross profit is revenue minus the direct cost of what you sold (COGS for products, or direct job cost for many services).

Gross profit = selling price − cost

Worked example

You buy a widget for $40 and sell it for $100. Gross profit = 100 − 40 = $60.

That $60 is the dollars available to cover rent, payroll, marketing, taxes, and net profit. Gross profit is not the same as net profit; net subtracts operating expenses and other costs after the gross line.

Why start here

  • Every margin and markup percent is built from these same two inputs: cost and price (or revenue)
  • If cost is wrong (missing freight, packaging, payment fees), both margin and markup lie
  • Per-unit gross profit times units sold estimates contribution before overhead

Track cost carefully: invoice cost + inbound shipping + duties + packaging often belongs in “cost” for pricing decisions even if your accountant capitalizes some items differently.

How Do You Calculate Gross Profit Margin?

Gross margin answers: “What percent of the selling price is profit?”

Gross margin % = (selling price − cost) ÷ selling price × 100

Same as: gross profit ÷ revenue × 100.

Example

Price $100, cost $40: margin = 60 ÷ 100 × 100 = 60%.

Price $50, cost $35: margin = 15 ÷ 50 × 100 = 30%.

Reading the number

  • A 25% margin means $0.25 of every sales dollar is gross profit; $0.75 covers cost of goods
  • Higher margin % does not automatically mean more cash — a 10% margin on $1M revenue is $100k gross profit; 50% on $50k revenue is $25k
  • Industry “healthy” margins vary widely (grocery vs software vs consulting)

For multi-item carts, compute margin on total revenue and total COGS, not by averaging product margin percentages unless each product has equal weight — weighted by revenue is safer. Percent change and part-whole percent patterns are covered in the how to calculate percentages guide.

Run any cost/price pair through the free online margin calculator to confirm margin % and profit dollars together.

How Do You Calculate Markup Percentage?

Markup answers: “What percent of cost did I add to get to price?”

Markup % = (selling price − cost) ÷ cost × 100

Same as: gross profit ÷ cost × 100.

Same dollars, different percent

Price $100, cost $40: markup = 60 ÷ 40 × 100 = 150%.

That is still $60 profit — identical to the 60% margin case above. Only the denominator changed (cost instead of price).

Another example

Cost $25, price $40: profit = $15. Markup = 15 ÷ 25 × 100 = 60%. Margin = 15 ÷ 40 × 100 = 37.5%.

Retail habit

Many buyers and wholesale sheets talk in markup (“keystone” often means roughly 100% markup — double the cost). Finance and dashboards more often show margin of revenue. When a vendor says “50%,” ask: of cost or of price?

If a sale tag cuts the list price, margin on the final selling price drops even if your original markup plan was solid. For percent-off math after you set list price, see the discount calculator and discount guide.

What Is the Difference Between Margin and Markup?

Both use the same gross profit in the numerator. The difference is the base:

MeasureFormula baseQuestion it answers
MarginSelling price / revenueWhat share of sales is gross profit?
MarkupCostHow much did I add on top of cost?

Why people mix them up

At low percents the numbers feel similar (20% markup is close to ~16.7% margin), so a slip is easy. At high percents they diverge hard: 100% markup = 50% margin; 200% markup ≈ 66.7% margin.

Quick comparison table (same cost $100)

  • Markup 25% → price $125 → margin = 25÷125 = 20%
  • Markup 50% → price $150 → margin = 50÷150 ≈ 33.3%
  • Markup 100% → price $200 → margin = 100÷200 = 50%
  • Margin 25% → price $133.33 → markup = 33.33÷100 ≈ 33.3%
  • Margin 40% → price $166.67 → markup ≈ 66.7%

Never apply a “25% margin target” by multiplying cost by 1.25 — that is a 25% markup and only a 20% margin. Use the conversion formulas in the next section or the margin calculator conversion mode.

How Do You Convert Margin to Markup (and Back)?

If you know one percentage, you can get the other without re-deriving cost and price — as long as both are expressed as decimals in the formula (25% → 0.25).

Margin → markup

Markup = margin ÷ (1 − margin)

Example: 40% margin → 0.40 ÷ (1 − 0.40) = 0.40 ÷ 0.60 ≈ 0.667 → 66.7% markup.

Example: 25% margin → 0.25 ÷ 0.75 ≈ 33.3% markup.

Markup → margin

Margin = markup ÷ (1 + markup)

Example: 50% markup → 0.50 ÷ 1.50 ≈ 33.3% margin.

Example: 100% markup → 1.00 ÷ 2.00 = 50% margin.

Sanity checks

  • Margin is always lower than markup for the same deal (while both are positive and under 100% margin)
  • Margin cannot be 100% or more if cost is positive — that would imply zero or negative cost
  • If cost is $0 (pure digital with no COGS), margin formulas still work on revenue, but markup is undefined or infinite

Keep a small cheat sheet for your target: if leadership wants “35% gross margin,” your markup target is 0.35 ÷ 0.65 ≈ 53.8% on cost.

How Do You Set Price From Cost and Target Margin?

When cost is known and you want a specific gross margin percentage:

Selling price = cost ÷ (1 − target margin)

Examples

Cost $40, target margin 60%: price = 40 ÷ (1 − 0.60) = 40 ÷ 0.40 = $100.

Cost $18, target margin 30%: price = 18 ÷ 0.70 ≈ $25.71 (round to your pricing rules, e.g. $25.99).

If you prefer thinking in markup: price = cost × (1 + markup). Cost $40 with 150% markup → 40 × 2.5 = $100 — same result as 60% margin.

Pricing checklist

  1. Confirm fully loaded unit cost (materials, inbound freight, packaging, expected spoilage).
  2. Pick margin or markup consistently with how finance reports.
  3. Compute list price; then model discounts and coupons that reduce realized price.
  4. Check competitors and willingness to pay — formula gives a floor/target, not automatic demand.
  5. Revisit when cost changes 5%+; a fixed dollar price with rising cost silently erodes margin.

After discounts, recompute margin on the actual cash price, not the list price. Sales tax is usually collected on top of price and is not your margin — see the sales tax calculator for tax-on-price math separate from profit.

What About Net Margin — and Which Mistakes Should You Avoid?

Net profit margin = net income ÷ revenue × 100. Net income is after operating expenses, interest, and taxes (and other P&L lines), not only after COGS.

A product can show a 55% gross margin and a 5% net margin if overhead is heavy. Use gross margin for unit pricing; use net margin for overall business health.

Common mistakes

  • Treating markup as margin — multiplying cost by 1.40 for a “40% margin” only yields ~28.6% margin
  • Ignoring discounts and returns — margin on list price overstates cash margin
  • Leaving fees out of cost — payment processing, marketplace commissions, and freights shrink real margin
  • Averaging margin % across SKUs without weights — a low-margin high-volume item dominates dollars
  • Confusing contribution margin with gross margin — definitions differ by which costs you treat as variable

This guide is educational business math, not accounting, tax, or legal advice. Use your books and a professional for formal financial statements.

For personal cash-flow context (what you keep from pay, not product margin), see the salary and take-home guide. For saving the profits you do keep, the savings calculator guide covers growth math on deposits.

Step-by-Step Instructions

  1. 1Open the free margin calculator on Generatr.
  2. 2Enter unit cost (or total cost) for the product or job.
  3. 3Enter selling price — or enter target margin/markup if you are solving for price.
  4. 4Read gross profit in dollars and margin percentage of price.
  5. 5Compare with markup percentage of cost on the same deal.
  6. 6If you only know one percentage, convert margin ↔ markup with the tool or formulas.
  7. 7Recompute after any planned discount so margin reflects the cash price.
  8. 8Save or note cost, price, margin, and markup for the SKU before you publish the list price.

Frequently Asked Questions

What is the formula for profit margin?+

Gross profit margin % = (selling price − cost) ÷ selling price × 100. Net profit margin uses net income instead of gross profit in the numerator, still divided by revenue.

What is the difference between margin and markup?+

Margin divides profit by selling price; markup divides the same profit by cost. A $60 profit on a $100 price is 60% margin and 150% markup if cost was $40.

How do I convert margin to markup?+

Markup = margin ÷ (1 − margin), using decimals. A 40% margin becomes 0.40 ÷ 0.60 ≈ 66.7% markup. Markup to margin: margin = markup ÷ (1 + markup).

How do I calculate selling price from cost and margin?+

Price = cost ÷ (1 − target margin). Cost $40 and 60% margin → 40 ÷ 0.40 = $100. With markup, price = cost × (1 + markup).

Is a 50% markup the same as a 50% margin?+

No. A 50% markup on cost $100 yields price $150 and margin ≈ 33.3%. A 50% margin on cost $100 requires price $200, which is a 100% markup.

Is Generatr’s margin calculator free?+

Yes. It runs in your browser so you can compute margin, markup, profit, and conversions without creating an account.

Ready to try it yourself?

Use the free Margin Calculator — no download, no account.

Launch Margin Calculator