Finance Runs locally Ready to use Built-in examples No tracking

Profit Margin Calculator

Enter unit cost and price to get gross margin, net margin, markup and unit profit; switch to break-even mode to find how many units you must sell.

Anyone selling anything needs this account in their head: an item bought for 30 and sold for 50 looks like a profit of 20 — until rent, power and packaging are spread across it. Break the unit economics down here: gross margin, the net margin once running costs are included, the mark-up over cost, and the profit and cost share per unit. Switch to break-even mode and it reports how many units a month cover the fixed costs.

Gross margin measures how much of the selling price is left after cost; mark-up measures how much has been added to the cost. The same trade is quoted one way in retail and the other way in financial statements, and mixing the two exaggerates the picture. Break-even units = fixed costs ÷ net profit per unit, where fixed costs are the ones that do not change with volume, such as rent and salaries.

How to use

  1. Enter the unit cost, the selling price and any per-unit costs.
  2. Read the gross margin, net margin, mark-up and profit per unit.
  3. Switch to break-even mode and enter the monthly fixed costs.
  4. Read how many units must sell each month to cover them.

How it works

Gross margin vs. markup

Gross margin = (price - cost) / price x 100%. With cost 60 and price 100 the gross margin is 40%, meaning 40 of gross profit per 100 sold; markup = (price - cost) / cost x 100%, which is 66.67% here, meaning "the cost was marked up 66.67%." Use markup for quoting, gross margin for assessing profitability.

How net margin is computed

Net margin also counts per-unit other costs (packaging, platform commission, allocated logistics): net margin = (price - cost - per-unit costs) / price x 100%. With cost 60, price 100 and per-unit costs 10, the net margin is 30%, 10 points below the gross margin.

How the break-even point is computed

Break-even volume = fixed costs / (price - per-unit variable cost). With fixed costs 5,000, price 100 and per-unit variable cost 60, the per-unit contribution is 40, so 125 units break even, with break-even revenue 12,500; each further unit earns 40 more.

Code example

JavaScript Three margin ratios and break-even

function margins(cost, price, fee = 0) {
  const profit = price - cost - fee;
  return {
    grossMargin: (price - cost) / price,       // gross margin (over price)
    netMargin: profit / price,                 // net margin
    markup: (price - cost) / cost,             // markup (over cost)
    profit
  };
}

const breakEven = (fixedCost, unitProfit) =>
  Math.ceil(fixedCost / unitProfit);           // units to break even

margins(100, 150, 10);      // 33.3% gross margin, 50% markup

Python The same formulas in Python

def margins(cost, price, fee=0):
    profit = price - cost - fee
    return {"gross": (price - cost) / price,
            "net": profit / price,
            "markup": (price - cost) / cost}

break_even = lambda fixed, unit: math.ceil(fixed / unit)

margins(100, 150, 10)   # gross 0.333, markup 0.5

FAQ

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

No. Gross margin uses price as the denominator, markup uses cost. A 40% gross margin corresponds to a 66.67% markup; a 40% markup corresponds to only a 28.57% gross margin. When discussing "a few points" with suppliers or customers, confirm which convention applies.

Why is a high gross margin still unprofitable?

The gross margin deducts only product cost, not platform commission, advertising, logistics, packaging, labor or fixed costs. Allocate those per unit to see the net margin, then combine with volume to check whether fixed costs are covered (the break-even point) — that's the real profitability.

Why round the break-even volume up?

Volume must be a whole number. If the result is 126.58, selling 126 still loses a little and you need 127 to truly break even, so the "units needed" shown usually rounds up; the exact value is also given for finer cost planning.

How do I compute the margin after a discount?

Use the discounted price as the new price and recompute. For example cost 60, original price 100, 20% off gives 80, dropping the gross margin to 25% and the markup to 33.33% — discounts hit margins harder than intuition suggests, so compute before quoting.

How big a gap between gross and net margin is normal?

It depends on the industry and channel costs, with no universal standard: offline retail often differs by only a few points, while e-commerce and delivery platforms with commissions often differ by 10-25 points. Judge by whether the gap covers rent, labor and advertising, and cross-check with the break-even volume.

Should my own wages and rent be in the cost?

Yes. The most common mistake for the self-employed is leaving family labor and owned-premises rent out of cost, showing gross profit but no real earnings. If these inputs have an opportunity cost (renting the premises, working elsewhere), include them at market rates in fixed costs, then compute the net margin.

How do I compute the overall gross margin for multiple products?

Weight by sales, not by simple average. Overall gross margin = (total price - total cost) / total price x 100%. For example product A sells at 100 with 40 gross profit and B at 900 with 90: a simple average is 25%, but the actual overall margin is (40 + 90) / 1,000 = 13%.

Cost and price are trade secrets — could they leak?

No. We can neither see nor obtain quoting, cost or margin data — the tool is purely front-end and all computation runs on your device, with no request sending the numbers out. History stays in your browser, visible only to this device, erasable with "clear," and incognito mode avoids leaving a trace.