Margin Calculator Online — Free Margin Calculator Tool
CodexFuse Team · 2026-11-01T13:14:24.079Z · 11 min read min read
Work out profit, margin and markup from cost and price — or price backwards from a target margin — with a free online margin calculator.
A margin calculator tells you how much of your selling price you actually keep after covering the cost of what you sold. If a product costs you $18 and you sell it for $30, you keep $12 — but whether that is a good result depends on whether you measure that $12 against the price or against the cost. This article explains the difference, works through a complete example, and shows how to price for a target margin instead of guessing.
What is a margin calculator?
Such a calculator works out profit, profit margin and markup from two numbers: what something cost you and what you sold it for. It subtracts cost from revenue to find profit, then expresses that profit as a percentage of the selling price for margin and as a percentage of the cost for markup, so you can compare products and prices on the same basis.
Margin and markup describe the same $12 of profit from different angles, and confusing them is expensive. Margin answers "of every dollar a customer pays me, how much do I keep?" Markup answers "how much did I add on top of what it cost me?" Because the selling price is always larger than the cost, markup is always the larger percentage — which is why a "40% markup" sounds healthier than the margin it really represents.
| Measure | Formula | On an $18 cost and $30 price |
|---|---|---|
| Profit | Revenue − cost | $30 − $18 = $12 |
| Margin | Profit ÷ revenue × 100 | $12 ÷ $30 = 40% |
| Markup | Profit ÷ cost × 100 | $12 ÷ $18 = 66.67% |
The free CodexFuse tool shows all three side by side, so you never have to trust a single percentage in isolation. That matters when a supplier raises a price, a marketplace takes a fee, or a discount eats into a margin you thought was safe.
Why do so many small sellers mix up margin and markup?
Small sellers mix up margin and markup because both are percentages built from the same profit, and everyday language treats them as interchangeable. They are not: margin divides profit by the selling price, while markup divides it by the cost, so the same sale can honestly be described as a 40% margin or a 66.67% markup — and only the margin tells you what share of revenue survives.
A discount cuts margin faster than most sellers expect. Cutting a $30 price by 10% to $27 leaves $9 profit on an $18 cost — a margin of 33.33%, not 30%. Always re-run the numbers after a sale, not before it.
A worked example: pricing ceramic mugs without guesswork
Meet Amna, a fictional online seller who makes ceramic mugs in small batches. This is a made-up scenario, but every number below is worked through exactly as the tool calculates it, so you can follow the same steps with your own figures.
The starting position: each mug costs Amna $18 all-in for clay, glaze, firing, packaging and postage materials. She currently sells each mug for $30. Her question is simple: is that price actually working?
Step 1 — the forward calculation: Amna enters cost $18 and revenue $30 into the margin calculator. It returns profit of $12, a margin of 40% and a markup of 66.67%. On the surface, that looks comfortable — she keeps 40 cents of every sales dollar before her other business costs.
Step 2 — testing other prices: instead of settling on $30, Amna uses the tool's quick comparison table to see what happens at nearby prices for the same $18 cost:
| Selling price | Profit | Margin | Markup |
|---|---|---|---|
| $24 | $6 | 25% | 33.33% |
| $28 | $10 | 35.71% | 55.56% |
| $30 | $12 | 40% | 66.67% |
| $36 | $18 | 50% | 100% |
| $40 | $22 | 55% | 122.22% |
The table makes the trade-off visible. At $24, Amna keeps only a quarter of the price, which leaves little room for platform fees or a damaged parcel. At $40, the margin is strong, but she may sell fewer mugs. The $30 to $36 range is where she can make a real decision rather than a hopeful guess.
Step 3 — pricing backwards from a target: Amna decides she needs a 50% margin to cover her shop fees, advertising and time after the $18 unit cost. She switches the tool to reverse mode, enters cost $18 and target margin 50%, and it gives her the price to charge: $18 ÷ (1 − 0.50) = $36. That single calculation replaces a whole afternoon of trial and error, and it is the formula to remember: price = cost ÷ (1 − target margin).
Set your target margin from your real overheads, not from a round number. Add up a month of fees, packaging extras, returns and your own time, divide by the units you expect to sell, and add that per-unit amount to your cost before you calculate margin. A margin on unit cost alone always flatters the result.
How do you use the free margin calculator, step by step?
You do not need an account, a spreadsheet or any setup to check a price. The tool runs in your browser, and nothing you type leaves your device. Follow these steps with your own numbers:
- Enter cost and revenue: type what one unit cost you and the price you sell it for, then read profit, margin and markup side by side.
- Compare prices: use the quick table to see profit, margin and markup at six different selling prices for the same cost, and spot where a small price rise buys a large margin gain.
- Work backwards: switch to reverse mode, enter your cost plus the margin you want to earn, and let the tool calculate the selling price that delivers it.
- Copy and record: use the one-click copy on the result to paste the figures into your price list, quote or product sheet, so the decision is documented rather than remembered.
Check your best seller first, then the product with the thinnest margin. A gross profit calculator is a useful companion check for total profit across units sold.
What does a healthy margin actually have to cover?
A margin on unit cost is only the first layer. Before you call a margin healthy, check it against everything that sits between a sale and money in the bank:
- Platform and payment fees: marketplace commissions and card fees come off the price, so a 40% product margin can become far less after fees.
- Delivery and returns: postage shortfalls, damaged goods and returns are real costs that rarely sit inside the unit cost you first entered.
- Tax and compliance: sales tax, accounting and any regulatory costs must be covered by the margin, not discovered at year end.
- Your time: making, packing, answering customers and handling problems all take hours — if the margin does not pay for them, the business is subsidising the customer.
- Room to grow: advertising, new stock and equipment all need funding, and a margin with no headroom leaves no budget for any of them.
Compare your margin with your own costs over time, and check it against the break-even point for the business as a whole.
If thin margins, surprise fees and endless price tweaks are eating your profit, CodexFuse gives you a fully managed home for your store, email and security on pay-as-you-go credits — so you can focus on pricing and selling instead of babysitting servers.
Get Started with CodexFuseWhere does this calculator stop? Honest limits
This tool answers one question well — what margin and markup does a given cost and price produce? — and it is honest about what it does not do. It requires revenue to be at least as large as the cost, so it cannot measure a loss-making sale; if you are selling below cost, that is a clearance or strategy decision to handle separately, not a margin to optimise. It also works on the figures you enter, so if your cost omits fees, tax or your time, the margin it shows will be higher than reality.
It does not track multi-product averages, currency conversion, bulk discounts or tax rules for you. For a discount, run the discounted price as a new revenue figure — a discount calculator helps you see the final price first — and then check the margin on that discounted price, not the original one. For borrowing or expansion decisions, check the full cost of finance with a business loan calculator before assuming a healthy product margin can carry a loan payment.
From a price check to a steadier business on CodexFuse
A margin check often exposes a second problem: the business around the product is costing more time and money than the margin allows. Separate hosting bills, an email service that fails, a site that slows down under traffic and backups you have to remember yourself all eat the margin you just calculated. CodexFuse is built for that exact gap — one fully managed platform, paid for with credits as you use it, with no subscription locking you in.
A practical way to move over looks like this. First, create a free CodexFuse account and bring your website or store onto managed hosting, so performance and security updates are handled for you. Next, move your business email to the same platform, so customer orders and supplier messages stop landing in a personal inbox or getting lost. Then turn on managed backups, so a failed update or a mistake does not become a day of lost orders. Because the platform runs on credits, you pay for what you use and can scale up or down as sales change — a useful fit when margins are tight and a fixed monthly stack would eat them further.
The rule for deciding whether this fits is straightforward: if you are spending more hours each week maintaining tools, chasing email problems or fixing your site than you spend improving products and prices, a managed platform is buying back the time your margin is supposed to pay for. If you only need a one-off price check, the free margin calculator on its own is enough — use it whenever a supplier price, fee or discount changes, and re-check before you commit to a new price.
Once your prices are set, total each order properly with an invoice calculator so tax, discount and shipping do not quietly undo the margin you just protected.
Frequently Asked Questions
What is the difference between margin and markup?
Margin divides profit by the selling price; markup divides profit by the cost. On an $18 cost and a $30 price, profit is $12, margin is 40% and markup is 66.67%. Markup is always higher because its base — the cost — is always smaller than the price.
How do I calculate margin from cost and selling price?
Subtract cost from price to get profit, then divide profit by price and multiply by 100. For a $60 cost and a $100 price, profit is $40 and margin is 40%. The margin calculator does this instantly and shows markup alongside it.
How do I find the price for a target margin?
Divide cost by one minus the target margin. For a 50% margin on an $18 cost, charge $18 ÷ (1 − 0.50) = $36. The calculator's reverse mode performs this calculation when you enter cost and target margin.
What margin should a small business aim for?
There is no single correct figure. It depends on your overheads, fees, returns and industry. Work out the margin that covers all of those costs with room to grow, track it over time, and be wary of any headline figure that ignores your own expenses.
Does the margin calculator handle losses or discounts?
No, it requires revenue to be at least as large as cost, so it is built for pricing decisions rather than measuring losses. For a discount, enter the discounted price as the revenue figure and check the margin on that price before approving the sale.
Is the CodexFuse margin calculator really free?
Yes. It is free and unlimited, runs entirely in your browser, and nothing you type leaves your device. You can use it for a single price check or for repricing a whole range.
Stop pricing on guesswork — check every price before you commit to it
Most pricing pain comes not from hard maths but from never doing the maths at all. A product that "feels" profitable can still lose money once fees, returns and your time are counted, and a small price change can be the difference between a business that grows and one that merely stays busy. Run your best sellers through the free calculator today, set a target margin based on your real costs, and re-check every price whenever a supplier, fee or discount changes.
And if the work around selling — hosting, business email, security and backups — is eating the margin you worked so hard to protect, move it all to CodexFuse. Create your free account, bring your hosting, email and security onto one fully managed platform on pay-as-you-go credits, and spend your time on products and customers instead of server babysitting. Get started with CodexFuse today and let your prices finally do the job they are meant to do.