Skip to content
CalculatorBuddy

Margin Calculator

Calculate profit margin and markup from any two of cost, revenue, margin, and profit — plus stock-trading and currency-exchange margin requirements.

Enter any two of cost, revenue, margin, and profit to calculate the rest and the markup.

ExampleSample values — edit any field to see your result.

$

The cost of the product. Leave blank if unknown — enter any two values.

$

The income generated by selling the product. Leave blank if unknown — enter any two values.

%

Profit as a percentage of revenue. Leave blank if unknown — enter any two values.

$

Revenue minus cost. Leave blank if unknown — enter any two values.

Results update as you type.

Margin

25.00%

Estimated result

Profit
$40.00
Markup
33.33%
Cost
$120.00
Revenue
$160.00

Cost vs profit margin

Cost 75%, Profit margin 25%
  • Cost75%
  • Profit margin25%

Three calculators sit on this page. Profit margin takes any two of cost, revenue, margin, and profit and fills in the rest plus the markup. Stock trading finds the cash a broker requires to buy shares on margin. Currency exchange finds the home-currency deposit for a leveraged FX trade.

Formula

Profit, margin, and markup all start from the same two money figures. Margin divides profit by revenue; markup divides the same profit by cost. Percents round to two decimals from the raw (unrounded) algebra; money rounds to the nearest cent independently.

profit  = revenue − cost
margin  = profit ÷ revenue × 100
markup  = profit ÷ cost × 100
revenue = cost ÷ (1 − margin)
        = cost × (1 + markup)

Stock-trading cash and the FX deposit are simpler products:

stock amount     = price × shares × (requirement ÷ 100)
currency amount  = exchange rate × units ÷ leverage ratio

A 25% margin is not a 25% markup. Convert with markup = margin ÷ (1 − margin) and margin = markup ÷ (1 + markup). Mixing the two up is a common way to underprice.

Margin vs markup at a glance

Same $40 profit on a $120 cost / $160 sale. Markup is always larger than margin on a profitable sale because cost is the smaller denominator.

You knowFormulaResult
Cost $120, revenue $160profit = 160 − 120$40.00
That profit vs revenue40 ÷ 16025.00% margin
That profit vs cost40 ÷ 12033.33% markup
Cost $120, 25% margin120 ÷ 0.75$160.00 revenue

Examples

$120 cost sold for $160

Profit is $40.00, margin is 25.00%, and markup is 33.33%. Cost is 75% of revenue on the chart; profit margin is the other 25%.

Price a $80 cost at a 20% margin

Revenue = $80 ÷ 0.80 = $100.00, profit is $20.00, and markup is 25.00%.

Buy 100 shares at $18.30 with a 30% requirement

Amount required = $18.30 × 100 × 0.30 = $549.00.

Buy 100 units at 1.30 with 20:1 leverage

Amount required = 1.30 × 100 ÷ 20 = 6.500 in home currency. The same trade at 1:1 needs 130.000; at 50:1 it needs 2.600.

Frequently asked questions

What is the difference between margin and markup?
Both start from the same dollar profit, but they divide by different bases. Margin is profit ÷ revenue (how much of the selling price is leftover). Markup is profit ÷ cost (how much you added on top of cost). A $120 cost sold for $160 is a $40 profit, a 25% margin, and a 33.33% markup — the markup is always the larger percentage on a profitable sale.
How do I calculate profit margin?
Subtract cost from revenue, then divide by revenue and multiply by 100. Margin = (revenue − cost) ÷ revenue × 100. On a $160 sale that cost $120, profit is $40 and margin is $40 ÷ $160 = 25%.
How do I find the selling price from cost and a target margin?
Divide cost by one minus the margin: revenue = cost ÷ (1 − margin). A $120 cost at a 25% margin needs a $160 price, because $120 ÷ 0.75 = $160. Equivalently, markup = margin ÷ (1 − margin), so a 25% margin is a 33.33% markup on cost.
What is a stock trading margin requirement?
It is the cash your broker requires you to deposit to buy shares with borrowed money. Amount required = price × shares × requirement. Federal Reserve Regulation T caps the initial loan at 50% of the purchase (a 50% initial margin); maintenance margin is at least 25%, and brokers often ask for more. The default example — $18.30 × 100 shares × 30% — needs $549.00 in the account.
What is currency-exchange margin?
In FX it is a good-faith deposit, not a fee — a slice of account equity set aside to keep a leveraged position open. Amount required = exchange rate × units ÷ leverage ratio. Buying 100 units at 1.30 with 20:1 leverage needs 6.500 in home currency. A 50:1 ratio is a 2% deposit; a 100:1 ratio is 1%. If losses eat the deposit, the broker issues a margin call and can close the position.

Related calculators