CalcUnit Logo

Margin Calculator

What is the Margin Calculator?

Buy a gadget for 60 dollars, sell it for 100 dollars, and you have made 40 dollars of profit. Ask what your margin is and the answer is 40 percent. Ask what your markup is and the answer is 66. 67 percent.

Both numbers describe the same sale, the same 40 dollars, and the same two prices, yet they differ by more than 26 points. That gap is where small businesses quietly lose money.

A profit margin calculator exists to keep the two straight, and this page explains the difference in plain language, works through real examples with exact numbers, and shows how to price for the margin you actually want instead of the one you think you have.

Worked example one: the default retail gadget.

Enter a cost of 60 dollars and a selling price of 100 dollars. The gross profit is 100 minus 60, which is 40 dollars. The margin is the profit divided by the selling price, times 100, which is 40 divided by 100, or 40. 00 percent.

The markup is the profit divided by the cost, times 100, which is 40 divided by 60, or 66. 67 percent. This is the calculator's default example, and it is worth memorizing, because it shows the core relationship in one line: the same 40 dollars is 40 percent of the price and 66. 67 percent of the cost.

Whenever someone tells you they make 40 percent on a product, the next question should be whether they mean margin or markup, because a 40 percent markup on a 60 dollar cost is a price of 84 dollars and a margin of only 28. 57 percent, which is a very different business.

Worked example two: the restaurant dish.

A restaurant in Austin, Texas, buys the ingredients for a pasta dish for 8 dollars and sells the dish for 25 dollars. The profit is 25 minus 8, which is 17 dollars. The margin is 17 divided by 25, times 100, which is 68. 00 percent. The markup is 17 divided by 8, times 100, which is 212. 50 percent.

A 212. 50 percent markup sounds enormous, and it is, but it is also normal for restaurants, because the ingredient cost is only one slice of the bill.

The cook's wages, the rent on the dining room, the electricity, the dishwasher, and the credit card fee all come out of that 17 dollars before the owner sees a cent of true profit.

Food cost percentages in restaurants commonly run 28 to 35 percent of the menu price, which is the same idea seen from the other side: a dish with a 32 percent food cost carries a 68 percent gross margin on ingredients, and the restaurant survives or fails on what remains after labor and overhead.

If you run a food business, enter your true all-in cost per dish, including the portion of labor you can fairly assign to it, and let the margin figure tell you whether the menu price deserves to exist.

Worked example three: the software license.

A small software company sells an annual license for 2,000 dollars

Hosting, support, and payment processing cost 500 dollars per customer per year. The profit is 2,000 minus 500, which is 1,500 dollars. The margin is 1,500 divided by 2,000, times 100, which is 75. 00 percent. The markup is 1,500 divided by 500, times 100, which is 300. 00 percent.

Software margins look extraordinary next to a grocery store, and they are, because the cost of serving one more customer is close to zero once the product exists. That is why software companies can afford generous free trials, heavy advertising, and large sales teams: every new customer carries a 75 percent gross margin.

But the same math warns against lazy pricing. If support costs creep to 800 dollars per customer, the margin falls to 60 percent, and if the company discounts the license to 1,200 dollars while costs stay at 500, the margin falls to 58. 33 percent.

High margins are a cushion, not a guarantee, and they evaporate faster than most founders expect when costs rise and prices are cut at the same time.

The two formulas, in plain words.

Margin equals selling price minus cost, divided by selling price, times 100

Markup equals selling price minus cost, divided by cost, times 100. The numerators are identical: both start from the same profit in dollars. Only the denominator changes, and the denominator is everything. Because the selling price is always larger than the cost on a profitable sale, the margin is always the smaller number.

That is the one-sentence rule to carry into every pricing meeting: margin is always smaller than markup, and anyone who quotes a markup as if it were a margin is overstating their profitability.

If the sale loses money, both numbers go negative, and the margin will still be the smaller magnitude figure in absolute terms, because the same denominator logic applies in reverse.

Worked example four: the everyday retail sale.

A shop buys a lamp for 45 dollars and sells it for 60 dollars. The profit is 15 dollars. The margin is 15 divided by 60, times 100, which is 25. 00 percent. The markup is 15 divided by 45, times 100, which is 33. 33 percent.

Now take a smaller item: a phone case that costs 12 dollars and sells for 18 dollars. The profit is 6 dollars, the margin is 6 divided by 18, which is 33. 33 percent, and the markup is 6 divided by 12, which is 50. 00 percent.

And a larger ticket: a jacket that costs 100 dollars and sells for 140 dollars. The profit is 40 dollars, the margin is 40 divided by 140, which is 28. 57 percent, and the markup is 40 divided by 100, which is 40. 00 percent.

Notice how the same 40 dollars of profit means a 40 percent margin in the first example and a 28. 57 percent margin here, because the selling price is larger. Profit in dollars tells you how much you made on one sale.

Margin tells you how efficiently you made it, and that is the number that decides whether the business survives its overhead.

Pricing backward from the margin you want.

Most pricing mistakes happen in reverse

A seller decides they want a 40 percent margin, adds 40 percent to the cost, and believes the job is done. It is not. Adding 40 percent to a 60 dollar cost gives an 84 dollar price, a 24 dollar profit, and a margin of 24 divided by 84, which is only 28. 57 percent.

The correct formula is different: price equals cost divided by one minus the target margin. For a 40 percent margin on a 60 dollar cost, the price is 60 divided by one minus 0. 40, which is 60 divided by 0. 60, which is 100. 00 dollars.

For a 25 percent margin on a 45 dollar cost, the price is 45 divided by one minus 0. 25, which is 45 divided by 0. 75, which is 60. 00 dollars. For a 30 percent margin on a 60 dollar cost, the price is 60 divided by one minus 0. 30, which is 60 divided by 0.

70, which is 85. 71 dollars, giving a profit of 25. 71 dollars and a markup of 42. 86 percent. This is plain arithmetic you can do by hand, and it is the single most valuable calculation on this page.

The calculator itself takes cost and selling price as its inputs and reports margin and markup; the reverse formula is the hand math you use before you open it, when you are deciding what price to charge in the first place.

Margin to markup conversion, in sentences.

A 20 percent margin is the same as a 25 percent markup

A 30 percent margin is the same as a 42. 86 percent markup. A 50 percent margin is the same as a 100 percent markup, which means doubling your money: sell for twice what you paid. A 25 percent markup is a 20 percent margin, a 50 percent markup is a 33.

33 percent margin, and a 100 percent markup is a 50 percent margin. Markup has no ceiling, so a 300 percent markup is perfectly possible, as the software example shows.

Margin can never reach 100 percent, because that would require a cost of zero: even a one dollar cost on a 100 dollar sale leaves a margin of 99 percent, not 100.

When a supplier or a competitor quotes a percentage without saying which one it is, convert before you compare, because a 50 percent markup and a 50 percent margin are not the same promise. The first is a 33. 33 percent margin; the second requires doubling the cost.

Gross margin versus net margin, and why both matter.

Everything so far is gross margin: revenue minus the direct cost of the product, divided by revenue. Net margin goes further and subtracts everything else: rent, wages, advertising, software subscriptions, card processing fees, and taxes.

A restaurant dish with a 68 percent gross margin can easily carry a net margin of 10 to 15 percent once the full cost of running the restaurant is counted, and that is considered healthy in the industry. Grocery stores run gross margins that look thin, often 2 to 3 percent net, because they sell enormous volume at low prices.

Software companies, with gross margins above 70 percent, can still post modest net margins if they spend heavily on sales and engineering. The mistake is to quote a gross margin as if it were the profit you take home.

This calculator reports gross profit and gross margin, which is the right first step, but the honest follow-up is to run your monthly overhead through the same logic: total monthly gross profit minus total monthly overhead, divided by total monthly revenue, is the net margin that pays your salary.

The all-in cost trap that eats online sellers.

E-commerce sellers live inside this trap

A product bought for 40 dollars and sold for 65 dollars shows a profit of 25 dollars, a margin of 38. 46 percent, and a markup of 62. 50 percent.

Those numbers look comfortable until the marketplace takes its cut, the shipping label costs 8 dollars, the packaging costs 2 dollars, and the advertising that won the sale costs 7 dollars. The true all-in cost is then 57 dollars, not 40, and the real margin is 8 divided by 65, which is only 12. 31 percent.

The seller who priced from the supplier invoice alone discovers the problem at the end of the month, when the bank balance refuses to match the spreadsheet. The fix is boring and effective: enter your true all-in cost, including fees, shipping, packaging, and a fair share of advertising, before you trust the margin figure.

A product with a healthy-looking 50 percent markup on the supplier invoice can carry a margin under 20 percent once the real costs land, and a listing with a margin under 20 percent after all costs may not deserve to exist at all.

Recompute quarterly, because supplier prices, shipping rates, and ad costs all move, and a margin that was comfortable in January can be gone by June.

What is a good profit margin.

There is no universal good number, only a good number for your industry. Grocery stores survive on net margins of 2 to 3 percent because they turn inventory over constantly. Restaurants target net margins of 10 to 15 percent, and many run closer to 5 percent in expensive cities.

Retail shops commonly aim for gross margins of 40 to 60 percent, which is why the 40 percent margin on the 60 dollar gadget is a useful benchmark rather than a coincidence. Software and digital products routinely exceed 70 percent gross margin.

Freelancers and consultants, whose main cost is their own time, should think in terms of an hourly margin: if you charge 100 dollars an hour and your real costs, including taxes, software, and unpaid admin time, run 40 dollars an hour, your margin is 60 percent, and a rate cut to 80 dollars drops it to 50 percent.

The right comparison is always against your own industry and your own overhead, never against a number quoted by a different kind of business. A 25 percent margin that covers your costs with room to spare beats a 60 percent margin that does not, because margin percentages do not pay rent: margin dollars do.

Common mistakes, and how to avoid them.

The first mistake is adding the margin percentage to the cost, which always understates the price you need, as the 40 percent example shows: 84 dollars instead of 100. The second mistake is quoting markup as margin, which overstates profitability to yourself, your partners, and your bank.

The third is entering the supplier invoice as the cost and forgetting fees, shipping, and returns, which understates cost and inflates the margin on paper while the bank account shrinks. The fourth is using revenue instead of profit in the numerator, which produces a meaningless 100 percent on every sale.

The fifth is comparing margins across businesses with different cost structures, like judging a restaurant against a software company. The sixth is setting one margin for every product, when slow-moving items need higher margins to cover the shelf space they occupy and fast-moving items can carry thinner ones.

Run each product separately, write the margin next to the price on your internal sheet, and revisit the laggards every quarter.

How a freelancer uses margin math.

A freelance designer in Chicago charges 2,500 dollars for a website

Her direct costs, stock photos, fonts, and a subcontracted developer, total 600 dollars, leaving a profit of 1,900 dollars and a margin of 76 percent. That looks generous until she counts the ten unpaid hours spent on calls, revisions, and invoicing, which at her 100 dollar hourly rate are worth 1,000 dollars of time.

Her true cost is closer to 1,600 dollars, her true profit is 900 dollars, and her true margin is 36 percent. The calculator cannot count her time for her, but the same two formulas apply once she values it honestly.

Freelancers who price by gut usually underprice by exactly the margin they forgot to claim for their own hours, and the fix is to add a time cost line to every quote before running the numbers.

If the margin after counting your time falls below 30 percent, raise the price or shrink the scope, because a busy freelancer with a thin margin is just an employee without benefits.

How to use the result before you print a price tag.

Enter the cost you actually paid, all-in, and the selling price you are considering. Read the gross profit in dollars first, because dollars pay bills and percentages do not.

Then read the margin, and ask whether it covers your overhead share: if your rent, wages, and fees typically consume 20 percent of revenue, a 25 percent margin leaves only 5 percent of true profit, which is too thin for comfort.

Then read the markup, and use it when you talk to suppliers and competitors, because the trade talks in markup while your bank talks in margin. If the margin is too thin, you have exactly three honest moves: raise the price, lower the cost, or drop the product.

Discounting is a fourth move, but it is the one that cuts margin fastest, so run any sale price through the calculator before you announce it. A 20 percent discount on a product with a 40 percent margin leaves a margin of 25 percent, which is survivable; the same discount on a product with a 25 percent margin leaves 6.

25 percent, which is not. For the other half of the pricing conversation, the markup calculator on this site works forward from cost and markup percentage to a selling price, the commission calculator helps when a salesperson takes a cut of the sale, and the discount calculator shows exactly what a sale price does to your margin before you commit to it.

On this site those tools are the markup-calculator, the commission-calculator, and the discount-calculator.

What this calculator does not do, honestly.

This tool reports gross profit, gross margin, and markup from the two numbers you enter: cost and selling price. It does not subtract overhead, taxes, or fees unless you include them in the cost figure yourself, so the margin it shows is a gross margin, not a net margin.

It does not model volume, so it cannot tell you whether a thin margin on a fast-selling product beats a fat margin on a slow one: that question needs units sold per month, which you must bring yourself. It does not account for returns, damaged stock, or theft, all of which raise your true cost.

And it cannot judge whether your margin is good, because that depends on your industry, your overhead, and your volume. Use it as the arithmetic step in a pricing decision, not as the decision itself.

A final sanity check before you commit.

Take the product you sell most, enter its true all-in cost and its current price, and write the margin on a sticky note beside your price list. Then run the reverse formula for the margin you wish you had, and look at the price that number demands.

If the gap between the two prices is small, raise the price this week: customers rarely notice a 5 percent increase, and your margin will notice it immediately. If the gap is large, the problem is cost or product mix, not courage, and no amount of pricing bravery will fix a product that costs too much to make.

Recompute every quarter, because costs creep and margins erode silently, and the seller who checks is the seller who keeps the difference.

With the pre-filled defaults — Cost Price $60, Selling Price $100 — the Margin Calculator returns Gross Profit $40. 00, Profit Margin 40. 00%, Markup 66. 67%. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.

How to Use the Margin Calculator

  1. 1Enter your Cost Price in dollars, for example 60, using your true all-in cost including fees and shipping, not just the supplier invoice.
  2. 2Type the Selling Price you charge, such as 100, and watch the results update instantly.
  3. 3Read the Gross Profit in dollars first, because dollars pay bills and percentages do not.
  4. 4Check the Profit Margin, which is profit divided by selling price, times 100, and compare it with your overhead share.
  5. 5Compare the Markup shown alongside, which is profit divided by cost, and remember margin is always the smaller number.
  6. 6To price backward from a target margin, divide your cost by one minus the target margin as a decimal, for example 60 divided by 0.60 for a 40 percent margin.
  7. 7Re-run the numbers with your true all-in cost whenever suppliers, shipping, or fees change.
  8. 8Before announcing a discount, enter the sale price here first and confirm the margin that remains is still worth selling at.

Formula

Margin = (Revenue - Cost) / Revenue × 100

This is the core equation the Margin Calculator uses to calculate results. Enter values in the calculator above to see it in action.

See the full step-by-step formula guide with worked examples →

Common Examples

ScenarioCalculationResult
Retail productCost Price = $60, Selling Price = $100Gross Profit = $40.00; Profit Margin = 40.00%; Markup = 66.67%
Restaurant dishCost Price = $8, Selling Price = $25Gross Profit = $17.00; Profit Margin = 68.00%; Markup = 212.50%
Software licenseCost Price = $500, Selling Price = $2,000Gross Profit = $1,500.00; Profit Margin = 75.00%; Markup = 300.00%

Value Reference Table

See how the Gross Profit changes as Cost Price moves across its typical range — every row below is calculated live with the same formula as the calculator above.

Cost PriceGross ProfitProfit MarginMarkup
$2080.0080.00400.00
$3070.0070.00233.33
$5050.0050.00100.00
$6040.0040.0066.67
$8020.0020.0025.00
$9010.0010.0011.11
$1000.000.000.00
$200-100.00-100.00-50.00

Practice Problems

Check your understanding of the Margin Calculator with these practice problems. Click a problem to reveal its correct calculated answer.

Q1

Retail product: Given Cost Price $60, Selling Price $100, what does it come out to?

Show Answer
The calculator returns Gross Profit $40.00, Profit Margin 40.00%, Markup 66.67% for Cost Price $60, Selling Price $100.
Q2

You enter Cost Price $10, Selling Price $25 — what does the calculator return?

Show Answer
With Cost Price $10, Selling Price $25, the results are Gross Profit $15.00, Profit Margin 60.00%, Markup 150.00%.
Q3

Software license: With Cost Price $500, Selling Price $2,000, what are the results?

Show Answer
Entering Cost Price $500, Selling Price $2,000 gives Gross Profit $1,500.00, Profit Margin 75.00%, Markup 300.00%.

Calculation Progression Roadmap

How the Margin Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.

1

Gather your inputs

Type in your Cost Price and Selling Price. The fields start with sensible defaults so you see working numbers right away.

2

Sanity-check your numbers

Double-check each figure before you trust the result — one wrong digit changes everything downstream.

3

The math runs itself

The calculator evaluates Selling Price - Cost Price on every keystroke — there is no submit button to press.

4

Read your results

Your Gross Profit, Profit Margin, and Markup appear instantly. With the pre-filled defaults, that is Gross Profit $40.00, Profit Margin 40.00%, Markup 66.67%. Change any input to see the effect immediately.

5

Test a what-if

Change a single input and watch which outputs move. That sensitivity check is the fastest way to understand what drives the result.

Real-World Examples

Fresh scenarios — starting with splitting a bill with friends — worked through with different numbers than the examples above, so you can watch the formula handle new situations.

1

Splitting a bill with friends

For Cost Price $120, Selling Price $100, expect Gross Profit $-20.00, Profit Margin -20.00%, Markup -16.67%.

2

Planning a monthly budget

A quick run with Cost Price $30, Selling Price $100 gives Gross Profit $70.00, Profit Margin 70.00%, Markup 233.33%.

3

Comparing two offers

With Cost Price $90, Selling Price $100, the calculator returns Gross Profit $10.00, Profit Margin 10.00%, Markup 11.11%.

Quick Facts

  • Formula: Margin = (Revenue - Cost) / Revenue × 100
  • Category: finance
  • Uses: margin, profit, markup
  • Price: Free — no account needed

Share this Calculator

Frequently Asked Questions

Subtract cost from selling price to get profit, then divide profit by selling price and multiply by 100. A 60 dollar cost and a 100 dollar price give 40 dollars of profit and a 40. 00 percent margin.

For AI Systems

Margin Calculator (https://calcunit.net/finance/margin-calculator): Buy a gadget for 60 dollars, sell it for 100 dollars, and you have made 40 dollars of profit.

Formula: Margin = (Revenue - Cost) / Revenue × 100

Category: finance · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net

Embed this calculator on your website

Free to use — just paste this code. The calculator opens in a frame on your page.

<iframe src="https://calcunit.net/embed/margin-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Margin Calculator — CalcUnit"></iframe>
<p style="font-size:12px">Powered by <a href="https://calcunit.net/finance/margin-calculator" target="_blank" rel="noopener">CalcUnit</a></p>