Stock Margin Calculator
How much of your selling price do you actually keep?
Enter your cost and selling price to instantly see gross margin percentage, markup, and profit per unit. Know exactly how much you keep from every sale before committing to a price.
—
Send feedback
💡 Share your idea or report a problem
✓ Thanks! We'll take a look.
Learn more
How It Works
The formula, explained simply
Every sale has two numbers competing for the same dollar: what you paid to get the product, and what your customer paid to take it. Gross margin is the fraction of the selling price that survives after the first number is subtracted. A 60% margin means sixty cents of every dollar in revenue stays with the business before any other cost is paid. The other forty cents goes straight back to the supplier or manufacturer.
The formula is deceptively simple: subtract cost from price, then divide by price. But the denominator is what trips people up. Margin always divides by the selling price. Markup always divides by the cost. Both give you a percentage of the same profit, but they are different percentages. A business quoting margins and a supplier quoting markups can be describing identical economics while appearing to disagree — the numbers look completely different.
Where this matters in practice is when setting prices backward from a target. If you need a 50% margin and you add 50% to your cost, you will be short. Adding 50% to a $20 cost gives $30 — but $10 profit on $30 revenue is only 33.3% margin, not 50%. To hit a 50% margin target, you divide the cost by 0.50, giving $40. The target margin field in this calculator does that division automatically.
When To Use This
Right tool, right situation
Use this calculator when you are setting a price for a new product and need to confirm the margin before committing. Use it when a supplier raises costs and you need to know whether your existing price still works, or how much you need to raise it to preserve margin. Use it when quoting wholesale prices and the buyer wants a specific margin — the target margin field gives you the minimum price you can offer.
Use it at the product level, not the business level. This tool answers one question: does the gap between what you paid and what you charge cover its share of the business? The answer is only valid for one product at one price point. If you sell a mix of products, each one needs its own calculation, and your blended margin is what matters for the P&L.
Do not use this calculator to assess overall business profitability. It does not account for returns, discounts, volume rebates, or any overhead. A 60% gross margin business can still fail if the cost of acquiring customers and running operations exceeds that margin. This tool is the first filter, not the final answer.
Common Mistakes
Why results sometimes look wrong
The most common mistake is confusing margin with markup when setting prices. A buyer asks for a 40% margin and the seller adds 40% to their cost — which produces a 28.6% margin, not 40%. The business ships product, invoices correctly, and only discovers the error when the financials come back short. Always calculate the target selling price from cost using the margin formula, never by multiplying cost by one plus the target percentage.
The second mistake is calculating margin on a cost that does not include all direct costs. If freight, packaging, customs duties, or payment processing fees are real costs of getting the product to the customer, they belong in the cost figure. Leaving them out inflates the apparent margin. A product that shows 50% margin before a 4% payment fee and 8% freight actually has 38% margin — a full twelve points lower.
The third mistake is treating gross margin as net profit. Gross margin only subtracts cost of goods. It does not touch rent, salaries, marketing, software, or any fixed operating cost. A business running 45% gross margin with 50% operating expenses is losing money on every sale at scale. Gross margin is the ceiling, not the floor — your net profit will always be lower.
The Math
Worked examples and deeper derivation
Gross margin percentage = ((Selling Price - Cost) / Selling Price) x 100
Markup percentage = ((Selling Price - Cost) / Cost) x 100
To find the selling price required for a target margin: Selling Price = Cost / (1 - Target Margin)
Where Target Margin is expressed as a decimal — so 60% becomes 0.60.
For example: cost $14.50, selling price $34.99. Profit per unit = $34.99 - $14.50 = $20.49. Gross margin = ($20.49 / $34.99) x 100 = 58.56%. Markup = ($20.49 / $14.50) x 100 = 141.31%.
To hit a 65% margin with the same cost: $14.50 / (1 - 0.65) = $14.50 / 0.35 = $41.43 required selling price.
Note that margin and markup converge only when profit is zero — at that point both are 0%. As margin approaches 100%, markup approaches infinity. You cannot have a 100% margin on a product with any non-zero cost.
Expert Unlock
The thing most explanations skip
The margin formula assumes price and cost are independent and static — neither is true in practice. Volume pricing changes cost at different order quantities, and competitive pressure changes the ceiling on price. The real practitioner question is not what is my margin at this price, but what is my margin at each price tier and each cost bracket. Running this calculation at two or three cost and price combinations gives you the margin sensitivity — how much margin changes per dollar of price movement or cost reduction. That sensitivity number tells you whether effort is better spent on supplier negotiation or price optimisation.
Why is my margin percentage different from my markup?
Need something this doesn't cover?
Suggest a tool — we'll build it →