CALCULATORCASTLE

Margin Calculator

Calculate gross margin, markup, and profit percentage.

About

Margin Calculator

Margin is one word doing three different jobs. In a business it is the gap between what you sell something for and what it cost you. In a brokerage account it is the cash you put up while the broker lends you the rest. In currency trading it is the deposit held against a position while that position stays open. The three calculators above cover all three uses, and the sections below set out the arithmetic behind each one.

Profit margin and markup are two answers to the same question

Both describe the same profit. They divide it by different numbers, which is why they never agree.

Margin = (revenue - cost) / revenue x 100
Markup = (revenue - cost) / cost x 100

where:

  • cost is what the item cost you to make or buy
  • revenue is the price the customer actually pays
  • revenue - cost is the profit on that sale

Buy at $120, sell at $160, and you make $40. Divide the $40 by the $160 sale and the margin is 25%. Divide the same $40 by the $120 cost and the markup is 33.33%. One profit, two percentages, and the higher-sounding one is always the markup. Converting between them takes a single step:

Margin = markup / (1 + markup), with both as decimals. A 33.33% markup is 0.3333 / 1.3333, or 25%.

This matters because margin has a ceiling and markup does not. Margin can approach 100% but never reach it, since profit can never exceed the price it came out of. Markup runs to 200%, 500%, or higher on software and digital goods where the cost of one more copy rounds to nothing.

Pricing backwards from a margin you want

Most pricing questions run the other way: you know the cost and the margin you need, and you want the price.

Price = cost / (1 - target margin)

where target margin is written as a decimal, so 40% goes in as 0.40.

An item costing $120 sold at a 40% margin needs a price of 120 / 0.60, or $200. The profit is $80, and $80 divided by $200 is 40%. The trap is adding 40% to the cost instead. That gives $168, a profit of $48, and a real margin of 28.57%. Whole product ranges have been priced 11 points light by that one slip.

Gross, operating and net margin

The calculator above works out gross margin, which uses the direct cost of the goods sold. A full income statement gives you two more.

Gross margin subtracts materials and direct labour. Operating margin also subtracts rent, salaries, marketing and other running costs, which shows whether the business model works once the overhead is paid for. Net margin subtracts everything left over, including interest and tax, and is the figure that ends up as retained profit. A company can carry a 60% gross margin and still lose money at the net line if the overhead is heavy enough.

What counts as a healthy margin

There is no single number, and comparing across industries produces nonsense. Supermarkets run net margins of roughly 1% to 3% and make their money on volume and stock turnover. Restaurants typically land between 3% and 6% after wages and food waste. Software firms often post gross margins above 70%, because serving one more customer costs almost nothing. A 15% net margin would be excellent for a grocer and a warning sign for a software company.

The useful comparison is against your own history and against businesses of a similar size in the same trade. A margin that drifts down over four quarters while sales hold steady usually points at cost creep, discounting that was never signed off, or a supplier price rise nobody passed on.

Buying stock on margin

Trading on margin means borrowing from your broker to buy more shares than your cash covers, with the shares themselves standing as collateral.

Amount required = stock price x number of shares x margin requirement

where:

  • stock price is the price of one share
  • number of shares is how many you want to buy
  • margin requirement is the share of the purchase you fund yourself, as a decimal

At $18.30 a share, 100 shares is a $1,830 position. A 30% requirement means $549 of your own cash and $1,281 borrowed. Your money is controlling 3.33 times its own value.

Federal Reserve Regulation T caps the borrowed portion of an ordinary initial purchase at 50%, so the requirement cannot go below 50% at the point of buying. Brokers are free to ask for more, and many do on volatile or thinly traded stocks. The 30% in the example describes a house maintenance level rather than an opening trade.

Maintenance margin and the margin call

Once the position is open, the broker keeps checking that your equity covers a minimum share of its value. FINRA sets that floor at 25% for long positions, and most firms hold clients to 30% or 40%. Fall below it and the broker asks for cash, which is the margin call.

Call price = loan / (shares x (1 - maintenance rate))

where loan is the borrowed amount and maintenance rate is the broker minimum as a decimal.

With $1,281 borrowed against 100 shares and a 25% floor, the call lands at 1,281 / 75, or $17.08 a share. That is a drop of 6.7% from $18.30. A stock moving 7% against you is an ordinary Tuesday, and this is the part that surprises people: the call arrives long before the position looks like a disaster.

If you cannot meet the call, the broker sells your holdings without needing your agreement, at whatever the market pays that morning. Margin loans also charge interest, usually somewhere between 5% and 13% a year depending on the size of the balance, and that interest accrues whether the trade is working or not.

Currency exchange margin and leverage ratios

Forex margin is a good-faith deposit rather than a payment. It is a slice of your own equity, ring-fenced while the position is open, and released when you close it.

Amount required = exchange rate x units / leverage ratio

where:

  • exchange rate is what one unit of the target currency costs in your home currency
  • units is how much of that currency you are buying
  • leverage ratio is the first number in a quote like 20:1

Buying 100 units at a rate of 1.3 is a position worth 130 in your home currency. At 20:1 the margin is 130 / 20, or 6.500. Ratios and percentages are the same statement in different clothing: 20:1 is a 5% requirement, 50:1 is 2%, and 100:1 is 1%. Brokers revise these as volatility changes, often monthly, and tighten them around central bank meetings and elections.

Retail leverage is capped by regulators in most places. In the United States the CFTC limits retail forex to 50:1 on major pairs and 20:1 on minors. European rules under ESMA are tighter at 30:1 for majors. Offshore brokers advertising 500:1 are outside those regimes, and so is your money if something goes wrong.

What leverage actually does to the outcome

Leverage multiplies the percentage move, in both directions, and this is the whole of the risk in one sentence. At 3.33 times leverage, a 10% rise in the share price is a 33% gain on your cash. A 30% fall takes the entire $549 stake, because 30% of the $1,830 position is $549. The stock has to lose less than a third of its value to cost you everything you put in, and you still owe the loan.

The second chart under the stock calculator draws both paths on the same stock. The flatter line is what an unleveraged buyer experiences. The steeper one is yours. Nothing about the company changed between the two lines.

Mistakes that cost real money

Quoting margin when you meant markup is the most common one, and it shows up as a business that looks profitable on the spreadsheet and runs short of cash every month. Forgetting margin loan interest is next: an 8% annual rate on $1,281 is $102 a year, which quietly eats a chunk of any modest gain. The third is treating a maintenance requirement as a distant tripwire. Work out the call price before you buy, not after the market has moved.

Common questions

Frequently asked questions

It depends entirely on the industry. Supermarkets survive on net margins of 1% to 3%, restaurants usually run 3% to 6%, and software companies often post gross margins above 70%. Compare your margin against your own past quarters and against similar-sized firms in your own trade. A cross-industry comparison tells you nothing useful.

Divide the markup by one plus the markup, using decimals. A 50% markup is 0.5 / 1.5, which is 33.33% margin. Going the other way, markup = margin / (1 - margin), so a 25% margin is a 33.33% markup. The calculator above shows both figures at once so you do not have to do the conversion.

No. Margin divides profit by revenue, and profit can never be larger than the revenue it came from, so margin approaches 100% without reaching it. Markup has no such limit. Selling a $2 item for $50 is a 96% margin and a 2,400% markup.

Margin divides the profit by the larger number. Revenue always exceeds cost on a profitable sale, so dividing by revenue produces a smaller percentage than dividing by cost. The two only converge near zero profit.

Regulation T lets you borrow up to 50% of the purchase price on an ordinary initial trade, so $10,000 of stock needs at least $5,000 of your own cash. Brokers can and do demand more, particularly on volatile stocks, and pattern day traders must hold at least $25,000 of equity in the account.

Your equity falling below the maintenance requirement, which FINRA sets at 25% of the position value and most brokers raise to 30% or 40%. Equity is the current market value minus what you borrowed. Once you are under, the broker asks for a deposit, and if it does not arrive they sell your positions themselves.

Every unit of margin supports twenty units of position, which is the same as a 5% margin requirement. A 130 position needs 6.50 of margin. Losses are measured against the full 130, so a 5% move against you erases the deposit.

It amplifies the outcome in both directions and adds interest on the borrowed money regardless of how the trade goes. At 3.33 times leverage a 30% fall wipes out your stake completely. Anyone using margin should work out the call price and the annual interest cost before the trade, and should be able to fund a call without selling.