Margin Calculator
Free to use, with no sign up. Your entries stay in this browser; calculations run on your device.
Result
Gross profit = price − cost; margin% = 100 × (price − cost) / price; markup% = 100 × (price − cost) / cost. Price = cost / (1 − margin% / 100) = cost × (1 + markup% / 100).
Introduction to Business Math, section 4.3 defines markup on cost and on selling price (margin).
Worked example: $80 cost and $100 selling price give $20 gross profit, 20% margin and 25% markup. Entering $80 cost with 25% markup gives the same result.
Amounts are USD per item, with money inputs limited to cents; percentages use the unrounded solution. Margin uses selling price as its base; markup uses cost. Gross profit here is price minus entered cost, before any other expenses. Negative margin and markup represent a loss. Selling price must be positive. At zero cost, markup is undefined. Margin and markup alone are dependent ratios and cannot determine a cost or price; enter a money amount. Cost with 100% margin also cannot determine a positive price.
Arithmetic only; not financial advice.
Related calculators: Markup Calculator.
How to use this tool
Enter exactly two independent values and leave the other two blank. Include cost or selling price, then select Calculate. The markup preset starts with cost and markup.
Frequently asked questions
Is this calculator free and private?
Yes. Arithmetic runs in your browser without uploading your entries or saving them to browser storage.
What is the difference between margin and markup?
Both use price minus cost. Margin divides that amount by selling price; markup divides it by cost. A 25% markup corresponds to a 20% margin.
Can I enter any pair of values?
Use cost with price, margin or markup, or price with margin or markup. Margin and markup alone do not fix the dollar scale. At zero cost, markup is undefined; cost plus 100% margin has no unique positive-price solution.