📈

Margin Calculator

✓ Free & no signup 🔒 Runs 100% in your browser Updated 2026-11-25 Online Calculators

If you sell anything — products, services, freelance work — you need to know two numbers cold: your profit margin and your markup. They sound interchangeable, they are not, and confusing them is one of the most common ways small businesses underprice themselves. This calculator handles both directions of the problem. Enter a cost and a selling price to see your profit, margin, and markup, or enter a cost and a target margin to get the price you should actually charge.

The tool runs entirely in your browser: nothing you enter is transmitted anywhere, it is free, there is no signup, and it works on your phone at the supplier's warehouse just as well as on your desk. Results update live as you type, so you can test dozens of pricing scenarios in a minute.

Mode 1, Calculate margin, answers "where do I stand?" Mode 2, Price from margin, answers "what should I charge?" Both take a cost as the starting point, because every pricing decision starts with knowing what the item costs you, including shipping, packaging, and fees if you want the answer to be honest.

What Is Profit Margin?

Profit margin is the share of your selling price that is profit. If you sell an item for 80 and it cost you 50, your profit is 30, and your margin is 30 / 80 = 37.5%. Every dollar of revenue splits into a cost part and a profit part, and margin tells you the size of the profit slice relative to the whole dollar.

Margin is the number most business owners, investors, and accountants care about, because it is measured against revenue. When someone says "we run a 20% margin business," they mean that for every 100 of revenue, 20 survives as profit after direct costs. Gross margin specifically means revenue minus cost of goods sold, before overhead like rent and salaries; net margin is what remains after everything. This calculator computes the gross figure.

A healthy margin depends entirely on the industry. Grocery stores often run 1–3% net margins and survive on volume. Software companies can exceed 70% gross margin. Comparing your number to businesses with a different cost structure is meaningless, but tracking your own margin over time is one of the most useful health checks there is.

What Is Markup — and Why It Is Not Margin

Markup is the profit measured against cost, not against price. In the same example — cost 50, price 80, profit 30 — the markup is 30 / 50 = 60%. Same profit, different denominator, very different number.

Here is the trap. A retailer thinks "I want a 25% profit" and marks up costs by 25%. Cost 100, price 125, profit 25 — but 25 / 125 is only a 20% margin. To actually achieve a 25% margin, the price must be 100 / (1 − 0.25) = 133.33. That 8.33 difference per unit is real money when multiplied by volume, and it compounds: the higher the margin target, the bigger the gap. A 50% markup produces only a 33.3% margin; a 100% markup produces a 50% margin.

The table shows the relationship for a cost of 100:

Markup appliedSelling priceProfitMargin
20%120.0020.0016.67%
33.3%133.3033.3025.0%
50%150.0050.0033.33%
100%200.00100.0050.0%
150%250.00150.0060.0%

Rule of thumb: markup is always larger than margin for the same deal, and they only converge toward each other at very low profit levels. If a supplier tells you something is "marked up 40%," your margin on resale depends on your own cost structure, not theirs.

How to Use This Calculator (Step by Step)

Mode 1: Calculate margin from cost and price

  1. Select Calculate margin.
  2. Enter your cost per unit. Example: 40.
  3. Enter your selling price. Example: 65.
  4. Read the results: profit 25.00, margin 38.46%, markup 62.5%.

Mode 2: Price from cost and target margin

  1. Select Price from margin.
  2. Enter your cost per unit. Example: 40.
  3. Enter your target margin as a percentage. Example: 40.
  4. Read the results: required selling price 66.67 and profit 26.67. That is what you must charge to truly keep 40% of every sale.

Try your current prices in mode 1 first. Once you see your real margins, switch to mode 2 and find the price that hits your target. If that price looks unsellable, the conclusion is not "skip the math" — it is that your cost needs to come down or your target needs to move.

How It Works: The Formulas

Mode 1 uses three straightforward formulas:

  • profit = selling price − cost
  • margin % = (price − cost) / price × 100
  • markup % = (price − cost) / cost × 100

Worked example: cost 120, price 150. Profit is 30. Margin is 30 / 150 × 100 = 20%. Markup is 30 / 120 × 100 = 25%. Notice again: 20% margin equals 25% markup.

Mode 2 reverses the margin formula. Since margin = (price − cost) / price, rearranging gives:

  • price = cost / (1 − margin / 100)
  • profit = price − cost

Worked example: cost 120, target margin 25%. Price is 120 / 0.75 = 160.00, and profit is 40.00. Check: 40 / 160 = 25%. The formula breaks down if you enter a margin of 100% or more — you cannot keep 100% of a price while covering a nonzero cost — so the tool flags anything at or above 100 as impossible.

Common Use Cases

  • E-commerce sellers. Your true cost includes product, inbound shipping, packaging, and marketplace fees. A product bought for 18 and sold for 45 after 9.50 in total fees has profit 17.50 and a real margin of 38.9% — not the 60% you might have assumed from the buy/sell spread.
  • Contractors and freelancers. If you want a 50% margin on work that costs you 600 in labor and materials, the quote is 600 / 0.5 = 1,200. Charging 900 gives you 33.3%.
  • Retail buyers. When a vendor quotes a cost of 35 and your store policy is a 45% margin, the required retail price is 35 / 0.55 = 63.64.
  • Menu pricing. Restaurants often target 25–35% food cost as a percentage of menu price. A dish with 6.50 in ingredients at a 30% food cost (70% margin) should be priced near 21.67.
  • Checking whether a sale is worth it. A 20% discount on a 38.33%-margin product (cost 37.50, price 60.75) drops the price to 48.60 and the margin to 22.8% — a much bigger proportional hit than the discount suggests.

Tips and Best Practices

  • Use fully loaded costs. Include freight, duties, payment processing, and packaging in the cost input. A margin computed on bare product cost flatters you and hides thin reality.
  • Separate gross from net thinking. Gross margin of 40% with 35% overhead means 5% net. The calculator gives you the gross number; subtract overhead mentally before celebrating.
  • Set margin targets by role of the product. Many retailers run lower margins on traffic-driving staples and higher margins on accessories. Do not force one target across the catalog.
  • Recalculate when costs move. If your cost rises 10%, the price needed to hold the same margin rises by the same 10% — margins are ratio-preserving under proportional cost changes, but only if you actually reprice.
  • Convert when talking to suppliers. Supplier conversations use markup; financial statements use margin. Keep the two vocabularies straight and translate deliberately.

Limitations Worth Knowing

This tool computes single-product, gross-level figures. It does not allocate fixed overhead, marketing spend, or returns across products, so a 30% gross margin product is not necessarily profitable once you account for rent and ads. It also ignores volume effects: pricing to a 60% margin might cut unit volume enough to lower total profit, which is a strategy question no ratio calculator can answer. Use it for per-unit economics and pricing floors, then layer demand, competition, and overhead analysis on top.

Margin Calculator vs. Doing It by Hand

The math itself is four formulas, and you can absolutely do it by hand — but the failure mode is not arithmetic, it is using margin arithmetic where markup arithmetic belongs, or vice versa. This tool shows both numbers side by side in mode 1, so the mismatch is visible every time, and mode 2 removes the division entirely when you are pricing forward. It is free, instant, works on any device, and because all computation stays local in your browser, you can paste real cost and price data into it without those numbers ever leaving your device.

Frequently Asked Questions

What is the difference between margin and markup?
Margin is profit divided by selling price; markup is profit divided by cost. On a cost of 50 sold for 80, profit is 30, so margin is 30/80 = 37.5% while markup is 30/50 = 60%. Markup is always the larger number for the same transaction. Confusing them leads to underpricing: marking up cost by 25% yields only a 20% margin. Financial reporting uses margin; supplier and trade conversations often use markup.
How do I calculate a selling price from a target margin?
Divide your cost by 1 minus the margin expressed as a decimal. For a cost of 120 and a 25% target margin, the price is 120 / (1 − 0.25) = 120 / 0.75 = 160.00, giving 40 profit. Verify: 40 / 160 = 25% margin. A common mistake is multiplying cost by the margin and adding it, which produces a markup, not a margin, and always undershoots the target. The Price from margin mode does this division for you.
What is a good profit margin for a small business?
It depends heavily on the industry. Retail and grocery often run gross margins of 25–35% with single-digit net margins; restaurants target food costs of 25–35% of menu price; consulting and software can exceed 50–70% gross margins. A better benchmark is your own trend over time and competitors in your exact sector. Also distinguish gross margin (revenue minus direct costs) from net margin (after overhead) — a 40% gross margin with 35% overhead leaves very little.
How do I calculate margin in dollars and percent?
Profit in dollars is simply selling price minus cost: on a 65 sale with a 40 cost, profit is 25. Margin percentage divides that profit by the selling price: 25 / 65 × 100 = 38.46%. Markup percentage divides by cost instead: 25 / 40 × 100 = 62.5%. Enter the same two numbers into Calculate margin mode and it displays all three values at once, updating live as you type.
Why is a 50% margin not a 50% markup?
Because the two use different denominators. A 50% markup on a cost of 100 sets the price at 150, but the 50 profit is 50/150 = 33.33% of the price. To get a true 50% margin on a cost of 100, you must charge 100 / (1 − 0.5) = 200, which is a 100% markup. The relationship widens as margins grow: a 60% margin requires a 150% markup. This divergence is why pricing by markup habit systematically misses margin targets.
Can the margin percentage ever be 100% or negative?
A gross margin of 100% is impossible whenever cost is positive, since the formula price = cost / (1 − margin) divides by zero at 100; the tool treats margins of 100% or more as invalid. Negative margins happen when you sell below cost: cost 80 sold for 60 gives profit −20, margin −33.3%, and markup −25%. Businesses sometimes deliberately sell at negative gross margin as loss leaders, but they need to know exactly how much each sale costs them, which is precisely what the calculator shows.

Related Tools