- Margin = position value ÷ leverage.
- Position value = contract size × lots × price (for USDJPY it is simply contract size × lots in USD).
- Margin is a deposit, not a cost — but the more you use, the less room your account has.
- Margin decides whether you can open a trade; your stop loss decides how much you can lose.
The margin formula explained
With leveraged CFDs you do not pay the full value of a position. Instead, a fraction of that value is locked as margin while the trade is open. The calculator uses two steps:
Position value = contract size × lots × price, then Margin = position value ÷ leverage. For pairs where the US dollar is the base currency, such as USDJPY, one lot is already 100,000 dollars, so the position value in USD is simply contract size × lots and the price is not needed. The column Margin as % of position is just 1 ÷ leverage: 1:100 means 1%, 1:20 means 5%.
| Instrument | Illustrative contract size | Position value in USD |
|---|---|---|
| EURUSD, GBPUSD | 100,000 units of the base currency | 100,000 × lots × price |
| USDJPY | 100,000 USD | 100,000 × lots |
| XAUUSD (gold) | 100 troy ounces | 100 × lots × price |
| US30, NAS100 | 1 unit per index point | 1 × lots × index level |
These contract sizes are common examples, not a promise of what any account uses. Always check the contract specification in the app before trading.
Worked examples: EURUSD and USDJPY
EURUSD. For example, you want to buy 1 lot of EURUSD at 1.0850 with 1:100 leverage. Position value = 100,000 × 1 × 1.0850 = 108,500 dollars. Margin = 108,500 ÷ 100 = 1,085 dollars, or 1% of the position. Halve the size to 0.5 lot and the margin halves to 542.50 dollars.
USDJPY. For example, you sell 0.5 lot of USDJPY with 1:100 leverage. Because the base currency is the dollar, the position value is 100,000 × 0.5 = 50,000 dollars whatever the exchange rate. Margin = 50,000 ÷ 100 = 500 dollars.

Worked examples: gold (XAUUSD) and NAS100
Gold. For example, if gold were trading at 2,000 dollars and you bought 0.10 lot (10 ounces) with 1:100 leverage, the position value would be 100 × 0.10 × 2,000 = 20,000 dollars and the margin 20,000 ÷ 100 = 200 dollars. Because the gold price changes, the margin for the same lot size changes with it. See our gold price today page for how XAUUSD is quoted.
NAS100. Index CFDs often come with lower leverage than major currency pairs. For example, with 1 contract worth 1 dollar per point, an index level of 18,000 and 1:20 leverage, the position value is 18,000 dollars and the margin is 18,000 ÷ 20 = 900 dollars, or 5% of the position. Read more about trading US30 and NAS100.
Used margin, free margin and margin level
Once trades are open, the app tracks three numbers. Used margin is the total margin locked by your open positions. Free margin = equity − used margin, where equity is your balance plus or minus open profit and loss; it is what is left to open new trades or absorb losses. Margin level = equity ÷ used margin × 100%.
For example, with equity of 2,000 dollars and used margin of 500 dollars, free margin is 1,500 dollars and margin level is 400%. If open losses cut equity to 600 dollars, margin level falls to 120%. Keep falling and you reach the broker's margin call and stop-out levels, where positions can be closed automatically. Our guide to leverage and margin explains this step by step.

How to use the margin calculator before a trade
A common habit is to keep total used margin well below your equity so that normal price swings do not push the account towards a margin call. Remember that leverage magnifies both profits and losses: CFDs are complex and carry a high risk of losing money rapidly, and the margin figure says nothing about how much you could lose if the market moves against you.
- Pick the instrument and enter the lot size you are considering — ideally the size from the lot size calculator, based on your stop loss.
- Enter the current price from the app's quote screen and your account leverage.
- Read the margin required and compare it with your free margin.
- If one trade would use a large share of your free margin, reduce the size or skip the trade.
- Place the order in the QTFX Markets app with a stop loss, then watch margin level in the account view.
Questions & answers
How do I calculate margin in forex?
Multiply contract size by lots by price to get the position value in the quote currency, convert to your account currency if needed, then divide by your leverage. For 1 lot of EURUSD at 1.0850 with 1:100 leverage, margin is about 1,085 dollars.
Is a leverage calculator the same as a margin calculator?
They use the same relationship. A margin calculator starts from leverage to find the margin; a leverage calculator works backwards from position value and margin to find the effective leverage you are using.
Does higher leverage mean higher risk?
Higher leverage lowers the margin needed, which makes it easier to open oversized positions. Your actual risk comes from position size and stop distance, so size trades by risk, not by available margin.
Why did the margin for gold change with the same lot size?
Gold margin depends on price. When XAUUSD rises, the position value of the same lot rises, so the margin required rises too.



