start learning →
beginner15 min read

How to calculate forex margin and leverage, with worked examples

The margin formula, step by step: converting into your account currency, margin rate versus leverage ratio, margin level down to the ESMA 50% close-out, and the gap between maximum and effective leverage.

key takeaways
  1. Required margin = position size × contract size × price ÷ leverage, which is the same as notional value × margin rate.
  2. Margin is worked out in the base currency of the pair and converted into your account currency at the current rate, so it moves as prices move.
  3. Margin level = equity ÷ used margin × 100; EU retail accounts must be closed out once it falls to 50%.
  4. Maximum leverage only sets the deposit. Effective leverage, total exposure divided by equity, is what decides how fast the account moves.
  5. Size the trade from the risk first, then check the margin; margin is a deposit, not a measure of what you can lose.

To calculate forex margin, multiply the position size in units by the price to get the notional value, then divide by the leverage allowed on that pair: required margin = lots × contract size × price ÷ leverage. One standard lot of EUR/USD at 1.0800 is worth $108,000, so at the 30:1 maximum that applies to EU retail clients, the margin is $108,000 ÷ 30 = $3,600. If your account is held in a different currency from the one the result comes out in, you convert it at the current exchange rate.

That is the whole calculation. The rest of this guide is about doing it correctly when the currencies do not line up, understanding what the numbers on your platform mean once a trade is open, and avoiding the most common misreadings. If you want the answer without the arithmetic, our margin calculator does all of it, including the currency conversion. All prices and account sizes below are illustrative examples, not quotes or forecasts.

The margin formula, piece by piece

Every term in the formula is worth pinning down, because most errors come from getting one of them slightly wrong.

  • Lots. The size of your position as shown on the order ticket. One standard lot is 1.0, a mini lot is 0.1, a micro lot is 0.01. Our guide to lot sizes and position sizing covers these in detail.
  • Contract size. The number of units of the base currency in one lot. For forex this is almost always 100,000. For CFDs on other instruments it is different (one lot of gold is commonly 100 troy ounces, for example), which is why you should always check the contract specification on your platform.
  • Price. The current exchange rate of the pair. Multiplying units of the base currency by the price gives the notional value in the quote currency.
  • Leverage. The maximum ratio the broker allows on that instrument, such as 30:1. Some platforms write it the other way round, as 1:30. It means the same thing.

Lots × contract size × price is the notional value: the full size of the exposure you are taking on, which is the figure your profit and loss is calculated on. Dividing it by the leverage gives the slice of that exposure the broker asks you to put up as a deposit.

Margin rate and leverage ratio are the same thing

Brokers quote margin requirements in two ways. Some show a leverage ratio (30:1), others show a margin rate (3.33%). They are reciprocals of each other: margin rate = 1 ÷ leverage, and leverage = 1 ÷ margin rate.

  • 30:1 leverage = 3.33% margin rate
  • 20:1 leverage = 5% margin rate
  • 10:1 leverage = 10% margin rate
  • 5:1 leverage = 20% margin rate
  • 2:1 leverage = 50% margin rate

So the formula can equally be written as required margin = notional value × margin rate. A $108,000 position at a 3.33% margin rate needs $3,600 (strictly, 3.333…%, which is why the leverage form is easier to compute exactly). Contract specifications on many platforms list the margin rate as a percentage, so it helps to recognise both forms.

Why the base currency matters

For any forex pair, the simplest version of the calculation is done in the base currency, the first currency in the pair. One lot of EUR/USD is €100,000 of exposure regardless of the exchange rate, so the margin in euros is simply €100,000 ÷ 30 = €3,333.33. Multiply by the price only when you want the answer in the quote currency (here, dollars). If neither currency matches your account, you convert from whichever is convenient. Our guide to currency pairs explained covers base and quote currencies if the terms are new.

Four worked examples in different account currencies

The four examples below cover the situations you are most likely to meet. In each one the exchange rates are illustrative and the leverage is the ESMA retail maximum for that pair.

Example 1: EUR account trading EUR/USD

You hold a euro account and want to buy 1 standard lot of EUR/USD. The base currency, the euro, is also your account currency, so no conversion is needed and the price does not even enter the calculation.

  • Notional in base currency: 1 × 100,000 = €100,000
  • Leverage: 30:1 (EUR/USD is a major pair)
  • Required margin: €100,000 ÷ 30 = €3,333.33

This is the one case where the margin stays fixed as the price moves, because it is denominated in the same currency as the position's base.

Example 2: USD account trading EUR/USD

Same trade, but your account is in US dollars. Now the margin has to be expressed in dollars, so you multiply by the price.

  • EUR/USD price (example): 1.0800
  • Notional in quote currency: 1 × 100,000 × 1.0800 = $108,000
  • Required margin: $108,000 ÷ 30 = $3,600

You can check this against example 1: €3,333.33 × 1.0800 = $3,600. Notice that if EUR/USD rises to 1.1000, the same open position now needs $3,666.67 of margin. Margin on an open trade is recalculated continuously in most platforms, so it drifts with the exchange rate.

Example 3: GBP account trading USD/JPY

This is the case that trips people up, because neither currency in the pair is your account currency. You want to buy 0.5 lots of USD/JPY from a sterling account.

  • Notional in base currency: 0.5 × 100,000 = $50,000
  • Leverage: 30:1 (USD/JPY is a major pair)
  • Margin in base currency: $50,000 ÷ 30 = $1,666.67
  • GBP/USD rate (example): 1.2700
  • Margin in account currency: $1,666.67 ÷ 1.2700 = £1,312.34

The USD/JPY price itself does not matter here, because the base currency is the dollar and you convert dollars straight into pounds. You could also go the long way round (notional in yen = $50,000 × 150.00 = ¥7,500,000, margin in yen = ¥250,000, then convert yen to pounds through GBP/JPY), and you would land on the same figure apart from rounding. The USD/JPY pair profile explains the pair's quoting conventions.

Example 4: a minor pair at 20:1

Under ESMA rules, only pairs made up of two of the US dollar, euro, Japanese yen, pound, Canadian dollar and Swiss franc count as majors. Everything else, including AUD/USD and NZD/USD, is capped at 20:1. Suppose you hold a euro account and want to buy 0.3 lots of AUD/NZD.

  • Notional in base currency: 0.3 × 100,000 = A$30,000
  • Leverage: 20:1 (AUD/NZD is a non-major pair)
  • Margin in base currency: A$30,000 ÷ 20 = A$1,500
  • EUR/AUD rate (example): 1.6500
  • Margin in account currency: A$1,500 ÷ 1.6500 = €909.09

At 30:1 the same position would have needed €606.06. The lower cap on non-majors exists because these pairs tend to be less liquid and can move more sharply, and the difference is large enough to matter when you plan several positions at once.

The general recipe

Whatever the pair, the steps are the same:

  1. Work out the units of base currency: lots × contract size.
  2. Divide by the leverage for that instrument to get margin in the base currency.
  3. If the base currency is your account currency, stop. Otherwise convert into your account currency at the current rate.

The conversion rate your broker uses may include a small spread, and a few brokers calculate margin from the ask price for buys and the bid price for sells, so expect your platform's figure to differ from a hand calculation by a few units. If the difference is large, you have probably used the wrong leverage or the wrong lot size. For the wider picture on running an account in one currency and trading others, see currency conversion and your account base currency.

Balance, equity, used margin and free margin

Once a position is open, the platform tracks four figures and one ratio. The margin call and stop-out guide explains them in full, so here is the short version needed for the calculations that follow.

  • Balance: cash in the account from deposits, withdrawals and closed trades.
  • Equity: balance plus or minus floating profit or loss on open positions, including swaps.
  • Used margin: the sum of the margin held against every open position.
  • Free margin: equity minus used margin. This is what is left to open new trades or absorb losses.
  • Margin level: equity ÷ used margin × 100, shown as a percentage.

Margin level is the number that decides whether the broker warns you or starts closing positions. For EU retail clients, ESMA requires brokers to close out positions once equity falls to 50% of the margin required, which is a margin level of 50%. Many brokers also send a margin call warning at a higher level, often 100%, though the exact threshold is the broker's choice.

Worked example: margin level down to the 50% close-out

Here is a full walk-through with illustrative numbers. You have a USD account with a balance of $10,000 and buy 2 standard lots of EUR/USD at 1.0800.

  • Notional: 2 × 100,000 × 1.0800 = $216,000
  • Used margin at 30:1: $216,000 ÷ 30 = $7,200
  • Pip value: 2 lots × $10 per pip = $20 per pip (our pip value calculator gives this for any pair and account currency)
  • Starting margin level: $10,000 ÷ $7,200 × 100 = 138.9%
  • Starting free margin: $10,000 − $7,200 = $2,800

Now suppose the price moves against you. To keep the arithmetic clear, the used margin is held at $7,200; in reality it would drift slightly lower as EUR/USD falls, because the dollar value of the position shrinks.

  1. Down 50 pips: loss $1,000, equity $9,000, free margin $1,800, margin level 125%.
  2. Down 100 pips: loss $2,000, equity $8,000, free margin $800, margin level 111%.
  3. Down 140 pips: loss $2,800, equity $7,200, free margin $0, margin level 100%. At many brokers this is the margin call warning, and you can no longer open new positions.
  4. Down 200 pips: loss $4,000, equity $6,000, free margin −$1,200, margin level 83%.
  5. Down 280 pips: loss $5,600, equity $4,400, free margin −$2,800, margin level 61%.
  6. Down 320 pips: loss $6,400, equity $3,600, margin level 50%. The broker must now close positions.

The equity at close-out is easy to find directly: 50% of $7,200 is $3,600, so the account can lose $10,000 − $3,600 = $6,400 before the close-out, and $6,400 ÷ $20 per pip = 320 pips. A 320-pip move in EUR/USD is not an everyday event, but it is well within the range the pair has covered in a few weeks at various times, and the trade cost 64% of the account by the time it was closed.

Compare the same account opening only 0.5 lots. Used margin is $1,800, the starting margin level is 555.6%, and the close-out would come at equity of $900. That is a loss of $9,100, or 1,820 pips at $5 per pip, a move so large that any sensible stop-loss would have closed the trade long before. The lesson is not that 0.5 lots is the right size, but that the margin level you start from depends entirely on position size relative to equity.

Gaps over weekends or news can skip past the close-out level entirely, which is why EU and UK retail clients also have negative balance protection. The gap risk and weekend risk guide covers what happens in that case.

Effective leverage versus maximum leverage

The leverage in the formula is the maximum the broker allows on the instrument. It decides how much margin is held, but it says nothing about how much risk you are actually running. That is measured by effective leverage:

Effective leverage = total notional value of open positions ÷ equity

In the walk-through above, 2 lots of EUR/USD ($216,000) on $10,000 of equity is an effective leverage of 21.6:1. The 0.5-lot version ($54,000) is 5.4:1. Both trades used the same 30:1 maximum, and both needed margin calculated at 30:1, yet one account would lose 2.16% of its equity for every 1% move in EUR/USD and the other 0.54%.

Effective leverage rises as equity falls. If the 2-lot trade loses $4,000, effective leverage climbs to $216,000 ÷ $6,000 = 36:1, beyond the regulatory maximum, which is exactly why the close-out rule exists. Thinking in effective leverage rather than in available leverage is the habit that separates sizing from guessing. Our short guide to leverage and margin explains why the headline ratio is a ceiling and not a target.

A practical way to use this: size every position from the amount you are prepared to lose if your stop-loss is hit, using the position size calculator, then run that size through the margin calculator to confirm the margin fits comfortably inside your free margin. The guide to position sizing shows the risk side of that process step by step.

Multiple positions and hedged positions

Several open positions

With more than one trade open, used margin is normally the sum of the margin on each position, each converted into the account currency at current rates. Margin level is calculated on the whole account, not trade by trade. That has two consequences. First, a losing position can trigger a close-out even if every other trade is in profit, if the overall equity falls far enough. Second, positions on pairs that tend to move together can stack up exposure without the margin figure making it obvious. Two long positions on EUR/USD and GBP/USD each need their own margin, but in practice they are often a single bet against the dollar. The currency correlation guide covers this.

Hedged positions

If you hold a long and a short on the same instrument at the same time, how much margin is charged varies by broker and by account type. Common approaches include:

  • charging margin on both legs in full, as if they were unrelated;
  • charging margin only on the larger leg (sometimes called net or largest-leg margining);
  • charging a reduced rate on the hedged portion.

Some platforms also offer netting accounts, where opening an opposite trade simply reduces or closes the existing position rather than creating a hedge. The broker's account terms or contract specification will say which method applies. Whichever it is, a hedge locks in the loss between the two entry prices and pays spread and swap on both legs, so it does not make a losing position safer.

ESMA retail leverage caps

Since 1 August 2018, ESMA's product intervention measures have set the maximum leverage for retail CFD clients in the EU. National regulators, including CySEC and the UK FCA, apply the same limits. The caps are:

  • 30:1 (3.33% margin) on major currency pairs: any pair made of two of USD, EUR, JPY, GBP, CAD and CHF
  • 20:1 (5% margin) on non-major currency pairs, gold and major stock indices
  • 10:1 (10% margin) on commodities other than gold and on non-major stock indices
  • 5:1 (20% margin) on individual shares and other reference values not listed elsewhere
  • 2:1 (50% margin) on cryptocurrencies

These are maximums. A broker can set lower leverage, and some raise margin requirements temporarily around weekends, elections or major central bank decisions. Alongside the caps, the measures include the 50% margin close-out rule, negative balance protection for retail clients, a ban on sign-up incentives and a standardised risk warning. The guide to ESMA leverage limits and negative balance protection explains the rules and how they compare in other regions. If you trade CFDs on other asset classes, the guide to CFDs on stocks, indices and commodities shows how contract sizes change the margin arithmetic.

Professional clients, briefly

Clients who meet the MiFID II criteria and ask to be treated as professional can be offered higher leverage, because the ESMA caps apply only to retail clients. To qualify as an elective professional you generally need to meet at least two of three tests: significant trading activity over the previous four quarters, a financial instrument portfolio above €500,000, and relevant professional experience in the financial sector. Opting up means losing retail protections, including the leverage caps, and possibly negative balance protection and access to some compensation and complaint schemes. The formula for margin does not change; only the leverage figure plugged into it does. See the glossary entry on professional clients for a summary.

Common mistakes when calculating margin

  • Treating margin as the risk. Margin is a deposit, not a stop-loss. The 2-lot example above held $7,200 of margin but could lose $6,400 before any automatic closure, and more if price gapped. Your risk is set by position size and stop distance.
  • Forgetting the currency conversion. Calculating USD/JPY margin in dollars and reading it as pounds or euros produces a figure that is off by the exchange rate. Always finish in your account currency.
  • Using the wrong leverage for the pair. AUD/USD, NZD/USD and crosses such as EUR/AUD are 20:1 for EU retail clients, not 30:1. Using 30:1 understates their margin by a third.
  • Assuming margin is fixed. Unless the base currency is your account currency, margin on an open trade moves with the exchange rate. Over a long hold this can shift your margin level noticeably.
  • Opening positions until free margin reaches zero. Free margin is your buffer against losses, not spare capacity. An account with little free margin is one modest move away from a margin call.
  • Mixing up 30:1 and 1:30, or 3% and 3.33%. These look trivial but rounding a 30:1 rate to 3% understates margin by roughly a tenth.
  • Assuming hedges are margin-free. Some brokers charge both legs in full. Check before relying on it.
  • Ignoring contract size on non-forex CFDs. A lot of gold, oil or an index is not 100,000 units. Use the contract specification rather than assuming forex conventions.

Most retail CFD accounts lose money (ESMA found 74% to 89% in 2018), and leverage magnifies losses just as it magnifies gains. Positions that are large relative to equity leave very little room for error. The guide to why most retail CFD traders lose looks at the evidence.

Frequently asked questions

How do I calculate margin for a forex trade?

Multiply the number of lots by the contract size (usually 100,000) to get units of the base currency, divide by the leverage for that pair, then convert into your account currency at the current rate. For a USD account trading pairs quoted in dollars, the shortcut is lots × 100,000 × price ÷ leverage. The margin calculator does the conversion for you.

What is the difference between margin rate and leverage?

They are two ways of expressing the same requirement. A margin rate is the percentage of the notional value you deposit; leverage is the reciprocal of that percentage. A 5% margin rate is 20:1 leverage, and 30:1 leverage is a margin rate of 3.33%.

How much margin do I need for one lot of EUR/USD under ESMA rules?

At the 30:1 retail maximum, one standard lot needs €3,333.33 in a euro account. In a dollar account it needs the notional value divided by 30, which at an example price of 1.0800 is $3,600. In any other account currency, convert one of those figures at the current rate.

What margin level triggers a close-out in the EU?

ESMA rules require brokers to close out a retail client's positions once account equity falls to 50% of the margin required to keep them open, a margin level of 50%. Brokers may close out at a higher level and usually warn earlier. The margin call and stop-out guide explains the order in which positions are closed.

Does higher leverage mean I risk more?

Not by itself. Maximum leverage only decides how much margin is held. What you risk depends on position size and where your stop-loss sits. In practice, higher available leverage makes it easier to open positions that are too large for the account, and that is where the extra risk comes from.

Why does my platform show a slightly different margin from my calculation?

Usually because of rounding, a small spread on the conversion rate, the platform using the bid or ask rather than the mid price, or margin being recalculated as the price moves. A large gap usually means the leverage, lot size or contract size in your calculation differs from what the broker applies, so check the instrument's contract specification.

Not investment advice. This is general information and education, written without knowledge of your circumstances. It is not a recommendation to buy or sell any instrument. Past performance is not a reliable indicator of future results. Trading leveraged products carries a high risk of losing money. Risk warning