A margin calculator finds your gross margin, markup and profit from an item’s cost and selling price. Formula: Profit = price – cost. Margin% = (price – cost) / price x 100. Markup% = (price – cost) / cost x 100 (if cost > 0). Selling a $40 item for $100 is a 60% margin and a 150% markup.
On this page

How to use the margin calculator
- Enter the cost of the item.
- Enter the selling price.
- Read the margin, markup and profit.
How the margin calculator works
The margin calculator compares what an item costs you with what you sell it for. It shows three results:
- Profit = price − cost
- Gross margin = profit ÷ price × 100
- Markup = profit ÷ cost × 100
Margin is measured against the selling price, and markup is measured against the cost, so the same sale gives two different percentages. Cost and price cannot be negative, and the price cannot be zero; if cost is zero, markup is shown as not applicable.
Margin calculator worked example
Buy an item for $40 and sell it for $100. Profit is $60. Margin is $60 ÷ $100 = 60%, and markup is $60 ÷ $40 = 150%. If a supplier raises the cost to $60 and the price stays at $100, the margin calculator shows margin falling to 40% and markup to 66.67%. A sale below cost gives a negative margin, which is a loss.
| Cost | Price | Profit | Margin | Markup |
|---|---|---|---|---|
| $40 | $100 | $60 | 60.00% | 150.00% |
| $60 | $100 | $40 | 40.00% | 66.67% |
| $75 | $100 | $25 | 25.00% | 33.33% |
| $12 | $20 | $8 | 40.00% | 66.67% |
| $80 | $100 | $20 | 20.00% | 25.00% |
Margin versus markup
Mixing the two is a common pricing mistake. A 50% markup on a $40 item gives a $60 price, but the margin is only 33.3%. To hit a target margin, divide cost by (1 − margin): for a 40% margin on a $60 cost, the price is $60 ÷ 0.6 = $100. Margin can never reach 100% unless the cost is zero, while markup has no upper limit. Converting between them: margin = markup ÷ (1 + markup), and markup = margin ÷ (1 − margin).
What to include in cost
For gross margin, include the direct cost of the item: the purchase price, inbound freight and any direct labor or materials. Rent, marketing, software and other overhead are not part of gross margin but must be covered by it. The SBA advises small businesses to track these operating expenses and review margins regularly, because a healthy gross margin can still leave a net loss if overhead is high.
Tips
- Check margins after discounts and card fees, not just at list price.
- Compare margins across products to see which ones carry the business.
- Use a target margin to set prices when costs change.
Estimates for planning only, not legal, tax or financial advice. Check carrier, card network, lender and state rules before relying on a figure.
Setting prices from a target margin
Many retailers plan around a target gross margin for each product category. Grocery stores often run thin margins and rely on volume, while specialty shops and software firms aim much higher. Once you know the margin you need to cover overhead and leave a profit, the price follows from the cost. Suppose your rent, wages and other fixed costs come to $6,000 a month and you expect to sell 300 units. Each unit must contribute $20 before any profit. If each unit costs $30, a $50 price gives a $20 contribution and a 40% margin.
Discounts hit margin harder than many owners expect. On a product with a 40% margin, a 20% price cut from $100 to $80 drops profit from $40 to $20, so you must sell twice as many units to earn the same total. Before running a sale, enter the discounted price in the margin calculator and check how much extra volume you would need. Payment processing fees, returns and shipping you pay for the buyer also reduce the real margin, so subtract them from the price or add them to the cost when you check your numbers.
Related converters and calculators
Related calculators:
- Profit margin calculator: profit margin
- Percentage calculator: percentages
- Sales tax calculator: sales tax
- ROI calculator: returns
Sources
SBA: Manage your finances; SBA: Fund your business.
Formula and method
Margin = (price − cost) ÷ price × 100. Markup = (price − cost) ÷ cost × 100. Margin = markup ÷ (1 + markup).
Margin and markup use the same profit but divide it by different numbers: margin divides by the selling price, markup divides by the cost.
Questions about this calculator
What is the difference between margin and markup?
Margin divides profit by price; markup divides profit by cost.
What price gives a 40% margin on $60?
$100, since $60 ÷ 0.6 = $100.
Can margin be negative?
Yes, when the price is below cost.
Can margin exceed 100%?
No, not with a positive cost.
Does it include overhead?
No, it shows gross margin.
Check the assumptions and units before relying on a result. Financial, tax and health estimates do not replace advice for your individual circumstances.
Report a calculation issue