Margin Calculator
Three margin tools: profit margin and markup, the price for a target margin, and stock trading margin calls.
How to use the Margin Calculator
- Pick what you want to work out using the tabs: Profit margin, Price from cost or Stock trading margin.
- Enter Cost.
- Enter Revenue (selling price).
- Read your answer in the results panel. It updates as you type, and the breakdown, step-by-step working and any charts or tables appear below it.
- Use Share link to save or send the exact calculation, or Copy to paste the results elsewhere.
Margin vs markup
Both compare profit with something else, but with different bases, and mixing them up is a classic pricing mistake.
gross margin = (revenue − cost) ÷ revenue markup = (revenue − cost) ÷ cost
An item that costs $60 and sells for $100 makes $40 of profit. That’s a 40% margin but a 66.67% markup. Margin can never reach 100%, while markup has no upper limit.
| Margin | Equivalent markup |
|---|---|
| 20% | 25% |
| 25% | 33.3% |
| 33.3% | 50% |
| 40% | 66.7% |
| 50% | 100% |
Setting a price from a target margin
To hit a target margin, divide the cost by (1 − margin). Don’t multiply it by (1 + margin):
price = cost ÷ (1 − margin)
A $60 cost at a 40% margin needs a price of 60 ÷ 0.6 = $100. Adding 40% to the cost gives only $84, which is a 28.6% margin. With a markup target, multiply instead: price = cost × (1 + markup).
Stock trading on margin
Buying stock on margin means borrowing part of the price from your broker. Under Regulation T, the initial margin is usually 50%, so you put up half. If the price falls, your equity (the position value minus the loan) shrinks. Once equity drops below the maintenance margin (at least 25% under FINRA rules, often 30–40% at brokers), you get a margin call:
margin-call price = loan ÷ (shares × (1 − maintenance margin))
Example: you buy 100 shares at $50 ($5,000) with 50% initial margin, so you pay $2,500 and borrow $2,500. With 25% maintenance, the margin call comes at 2,500 ÷ (100 × 0.75) = $33.33, a one-third drop. Leverage works both ways. At 2× leverage, a 10% move in the stock is a 20% move in your equity.
Tips
- Gross margin ignores overheads like rent and salaries. Net margin, after all costs, is always lower.
- Compare your margins with industry norms. Grocery stores run on thin margins, while software can exceed 70%.
- Margin interest and possible forced sales make margin trading risky. This calculator is for education, not investment advice.
Frequently asked questions
What is the difference between margin and markup?
Margin is profit as a percentage of the selling price. Markup is profit as a percentage of the cost. A $40 profit on a $100 sale is a 40% margin but a 66.67% markup.
How do I calculate a selling price from a margin?
Divide the cost by 1 minus the margin as a decimal. For a 30% margin on a $70 cost, the price is 70 ÷ 0.7 = $100.
What triggers a margin call?
A margin call happens when your equity falls below the maintenance requirement, typically 25–40% of the position’s value. You then have to add cash or securities, or sell part of the position.
What is a good profit margin?
It varies widely by industry. Retailers often have gross margins of 20–50%, while software and luxury goods can exceed 70%. Compare yourself with businesses in the same sector.