Margin arithmetic · the denominator is the whole story

Margin Calculator: Cost, Price, Margin and Markup

Give the calculator any two of the five numbers and it returns the rest. Cost and price is the everyday case; cost and a target margin gives the price to charge; a shelf price and a margin gives the most you can pay for the goods. The same page solves backwards, which is where most calculators stop.

Any two → the other three Target-margin price Batch CSV table No login

Margin Calculator: Cost, Price, Margin and Markup

Solve for the missing numbers

The everyday case: you know what it cost and what it sells for.

Batch mode — paste a list of SKUs

One row per line: SKU, cost, price. Blank lines are skipped, currency symbols and thousands separators are tolerated, and the pasted text stays in your browser — it is never put in the share link.

Batch results
SKUCostPriceProfitMarginMarkup
MUG-11OZ $4.25 $14.00 $9.75 69.64% 229.41%
TEE-CLASSIC $9.10 $24.00 $14.90 62.08% 163.74%
STICKER-PACK $1.20 $6.00 $4.80 80% 400%
HAT-DAD $7.80 $19.50 $11.70 60% 150%
Total (4 rows)$22.35$63.50$41.1564.8%—

Result

Margin 60% profit ÷ price
Markup 150% profit ÷ cost
Profit $60.00 price − cost
Price $100.00
Cost $40.00
A $100.00 price less a $40.00 cost leaves $60.00. Price $100.00 Cost of the goods -$40.00 Profit $60.00

Estimating tool only. Not accounting, tax or legal advice.

60%margin · $60.00 profit on a $100.00 price

Three products, worked through

Every number below is produced by the same engine that runs in the browser, at build time — so an example cannot drift from the calculator above.

Cost $40, price $100

The preset: profit $60, margin 60% of the price, markup 150% of the cost. Two names for the same $60.

Cost $12.40, target margin 45%

The price has to be $22.55, not $17.98. Multiplying the cost by 1.45 charges a 45% markup, which is only a 31% margin.

Shelf price $24.00, margin 40%

The most you can pay for the goods is $14.40. Pay $16 and the margin is 33%, not 40%.

What a margin calculator actually has to answer

Margin work is five quantities in a fixed relationship: the cost, the price, the profit, the margin percentage and the markup percentage. Any two of them determine the other three, and the calculator should take any two rather than insist on one direction. Cost and price is the everyday case. Cost and a target margin is the case that gets people paid. A shelf price and a margin is the case that tells a buyer what they can pay.

The two percentages are where almost every mistake happens, because they share a numerator and differ only in the denominator. Margin divides the profit by the price. Markup divides the same profit by the cost. On a $40 cost and a $100 price the profit is $60, the margin is 60% and the markup is 150% — one product, one profit, two honest percentages that a supplier and a retailer will both quote as if they meant the same thing.

The calculator shows all five numbers at once for that reason. It is not enough to know that the margin is 60%; the useful question is what the markup is, so that a quote written in the other convention can be checked against the same sale.

How the two percentages are defined

The definitions are the standard ones and they are printed on the page so nothing has to be taken on trust. Margin percent equals price minus cost, divided by price, times one hundred. Markup percent equals price minus cost, divided by cost, times one hundred. The only difference is the denominator, and the denominator is the whole story: a margin can never reach 100% unless the cost is zero, while a markup has no upper limit.

Because margin divides by the price, a margin above 100% is refused rather than printed as a number. It would need a negative cost, which is a data-entry error, not a business. A cost of zero is refused for the opposite reason: markup divides by the cost, and dividing by zero is not a percentage. Both are returned as a plain sentence under the result instead of a blank or an Infinity.

A loss is legal and is carried through. Set the price below the cost and the profit, the margin and the markup all go negative and the result is flagged in red. Clamping a loss to zero is the one behaviour that would make this page actively misleading, so it does not happen.

Why the target-margin price is not the cost plus the margin

The single most expensive arithmetic error in pricing is adding the margin to the cost. If a job costs $100 and the target margin is 40%, the price is not $140. At $140 the profit is $40 on a price of $140, which is a 28.57% margin — a quarter short of the target. The price that delivers a 40% margin is $100 divided by one minus 0.40, which is $166.67.

The difference is not a rounding error, it is the margin itself. Dividing by one minus the margin grosses the price up so that the margin is a share of the price; multiplying the cost by one plus the margin leaves the margin as a share of the cost, which is a markup. At 40% the gap is $26.67 on a $100 cost, and it grows as the margin rises: at 60% the correct price is $250, not $160.

The margin-versus-markup page turns that gap into a table and a worked example, and the HVAC page applies it to a service job where the cost base is equipment, materials, labour and overhead rather than a single purchase price.

Where the numbers come from and what they do not promise

Everything on this page is arithmetic on the numbers you type, computed in your browser. The only external figures anywhere on the site are the Shopify card and transaction rates, which were read off Shopify’s own pricing page on 2026-11-24 and are shown with that date and left editable. Nothing here is a tax rate, a currency conversion or an accounting standard, and no figure is attributed to a source that does not carry it.

The batch table at the bottom of the page takes a pasted list of SKU, cost and price rows and returns the profit, margin and markup for each one, with a blended margin for the set. Currency symbols and thousands separators are tolerated, blank lines are skipped, and a row that cannot be read is reported rather than dropped. The pasted text stays in the browser and is deliberately kept out of the share link.

This is an estimating tool. It does not know your overhead, your returns, your payment fees or your tax position unless you put them in, and it is not accounting or tax advice. Use it to check a price, not to file a return.

Questions this page answers

What is the difference between margin and markup?

Both measure the same profit; they differ in the denominator. Margin is profit divided by the price, so a $40 cost sold at $100 is a 60% margin. Markup is profit divided by the cost, so the same sale is a 150% markup. A margin is always the smaller number, and it is the one that matches the profit share of the money that came in.

How do I work out the price for a target margin?

Divide the cost by one minus the margin as a decimal. For a $40 cost and a 60% target margin, $40 divided by 0.40 is $100. Adding the margin to the cost instead — $40 times 1.60 is $64 — leaves a 37.5% margin, not 60%.

Can a margin be more than 100%?

No. A margin of 100% would mean the cost is zero, because margin is profit divided by price and the price cannot be smaller than the profit. Markup has no such ceiling, which is why a 200% markup is an ordinary number while a 200% margin is refused here as a data-entry error.

What does a negative margin mean?

It means the price is below the cost and the sale loses money. The calculator carries the loss through and flags it rather than clamping it to zero, because a loss that reads as a small profit is worse than no answer at all.

Is this a tax or accounting tool?

No. It is arithmetic on the figures you enter. It applies no tax rate, converts no currency and knows nothing about your overhead, returns or fees. Treat the output as a price check, not as accounting or tax advice.

Estimating tool only. It applies the arithmetic you give it and nothing else: no tax rate, no currency conversion, no industry-average price. Confirm any price against your own supplier, your own overhead and your own tax position. Nothing you type is uploaded.

Put this calculator on your site

Embed this calculator

Copy the snippet into any page. The widget is free, needs no key and sends nothing until a visitor interacts with it.

Open widget view