Margin is the portion of your own funds a broker sets aside as collateral to open and maintain a leveraged position — it isn't a fee, but a good-faith deposit held from your account balance. The margin required is calculated from the position size and the leverage offered (e.g. 1% margin corresponds to 100:1 leverage).
If your account equity falls too close to the required margin, you risk a margin call or automatic position closure.
Next step
Calculator
Margin Calculator
Calculate the margin required to open a position at a given leverage, before you place the trade.