Margin Calculator - Profit Margin, Markup & Leverage
Margin Calculator
Profit margin: 30%
Result
- Profit margin
- 100 units
How one unit's price splits
- Cost70%
- Profit30%
About this margin calculator
This margin calculator works in three modes that all get called "margin". In profit-margin mode it turns a cost and a selling price into a profit margin percentage, a markup percentage, and the profit per unit, then multiplies by a quantity for total revenue, cost and profit. In trading-margin mode it turns an entry price, a number of units and a leverage ratio into the position value and the cash margin you must post. In margin-requirement mode it does the same trading sum, but you enter the margin requirement percentage directly instead of a leverage ratio, which suits brokers that quote a requirement rather than a ratio. The default values are examples only: a unit that costs 70 and sells for 100 across 100 units in profit mode, and a 200-unit position at an entry price of 50 with 10:1 leverage in trading mode. Switch mode at the top of the input card to match the question you are answering.
How the margin formulas work
Profit-margin mode first finds the profit per unit by subtracting cost from price: 100 - 70 = 30. Margin divides that profit by the selling price: 30 / 100 = 30%. Markup divides the same profit by the cost instead: 30 / 70 = 42.86%, which is why markup is always larger than margin for a profitable item. Quantity scales the per-unit figures: 100 units give 10,000 revenue, 7,000 cost and 3,000 total profit. Trading-margin mode multiplies entry price by units for the position value: 50 x 200 = 10,000, then divides by leverage for the required margin: 10,000 / 10 = 1,000, so the margin requirement is 100 / 10 = 10% of the position. Margin-requirement mode runs that last step in reverse: a 30% requirement on a 1,000 position is 1,000 x 30% = 300 of margin, the same as 100 / 30 = 3.33:1 leverage.
Practical tips and supporting tools
What this margin calculator does
Pick the mode that matches your question. Profit-margin mode is for pricing a product: enter what one unit costs you, what you sell it for, and how many units you are pricing, and the calculator returns the margin, the markup, and the profit in both per-unit and total form. Trading-margin mode is for a leveraged position: enter the entry price, the number of units or contracts, and the leverage your broker offers, and the calculator returns the full position value and the cash margin you must put up to open it. Margin-requirement mode is the same position sum with the inputs flipped: enter the margin requirement as a percentage and the calculator returns the cash margin and the leverage that requirement implies.
Worked example
In profit mode a unit that costs 70 and sells for 100 earns 30 of profit per unit. That is a 30% margin (30 / 100) and a 42.86% markup (30 / 70). Across 100 units the totals are 10,000 revenue, 7,000 cost and 3,000 profit. In trading mode a 200-unit position at an entry price of 50 is worth 10,000; at 10:1 leverage the required margin is 1,000, which is a 10% margin requirement.
Margin versus markup
Margin and markup describe the same profit from two different bases, and confusing them is the most common pricing mistake. Margin expresses profit as a share of the selling price, so a 30 profit on a 100 price is a 30% margin. Markup expresses the same 30 profit as a share of the cost, so on a 70 cost it is a 42.86% markup. To hit a target margin you cannot simply mark up by that percentage: a 50% margin needs a 100% markup, not a 50% one.
How trading margin and leverage relate
In a leveraged account the margin requirement is the inverse of leverage. At 10:1 you post 10% of the position; at 5:1 you post 20%; at 2:1 you post 50%. The calculator works out the position value from the entry price and number of units first, then divides by leverage, so a 10,000 position at 10:1 needs 1,000 of your own cash. Higher leverage frees up cash but magnifies both gains and losses on the full 10,000, not on the 1,000 you posted. If your broker quotes the requirement as a percentage instead, switch to margin-requirement mode and enter it directly: a 30% requirement returns the cash margin and the matching 3.33:1 leverage without you converting anything by hand.
When margin is negative
If the cost is higher than the price the profit per unit is negative and the margin and markup are reported as negative numbers rather than hidden. A unit that costs 120 and sells for 100 has a profit of -20 and a -20% margin, which is the signal to raise the price or cut the cost before selling. The calculator never clamps a loss to zero, so the totals also turn negative once multiplied by quantity.
How zero values are handled
Margin divides by the selling price, so when the price is zero the calculator reports the margin as undefined instead of dividing by zero. Markup divides by the cost, so a zero cost makes the markup undefined while the margin still reads 100%, because all of the price is profit. In trading mode leverage is clamped to a minimum of 1:1, which is the same as paying for the position in full with a 100% margin requirement.
When this calculator is most useful
- Product pricing: check that a selling price clears your target margin before you commit to it.
- Reselling and retail: convert a supplier markup into the margin you actually keep after the sale.
- Position sizing: see how much cash a leveraged trade ties up before you open it.
- Comparing offers: turn two cost-and-price quotes into comparable margin percentages.
Common mistakes to avoid
- Treating markup and margin as the same number: a 42.86% markup is only a 30% margin.
- Marking up by your target margin: a 50% margin needs a 100% markup, not 50%.
- Reading required margin as your risk: losses are calculated on the full position value, not on the margin posted.
- Forgetting tax: this tool works on pre-tax cost and price, so add VAT separately.
What this calculator does not do
- It does not add or remove sales tax or VAT; use the VAT calculator for that.
- It does not model overnight financing, spreads or commissions on a leveraged position.
- It is a pricing and sizing tool, not investment or trading advice.
Supporting calculators
- Percentage math: use the Percentage Calculator to work out the percentage change, increase or decrease behind any margin or markup figure.
- Tax on price: use the VAT Calculator to add or remove a VAT or sales-tax rate from your selling price, with per-unit and total views.
- Discount math: use the Discount Calculator to apply percent-off or fixed-amount discounts and see the price your margin has to absorb.