Margin calculation formula for forex instruments is the following:
(Lots * contract size / leverage) where the result is as always in the primary currency of the symbol.
For STANDARD accounts all forex instruments have a contract size of 100 000 units.
For instance, if the deposit currency for your trading account is USD, your leverage is 1:30 and you are trading 1 lot EUR/USD, the margin will be calculated like this:
(1 * 100 000/30) = 3,333 Euros.
Euro is the primary currency of the symbol EUR/USD, and because your account is USD, the system automatically converts the 3,333 EUROS to USD at the actual rate.
You can use our Calculator for your ease of use.