Margin is determined by the following equation:

It looks complicated, but it isn't. Here's an explanation:
M is the margin, V is the market value of the securities, and L is the broker’s loan. The ratio is expressed as a percentage. The lowest initial margin, or the margin at the time of the purchase, is 50% (as set by the Federal Reserve Board). After the purchase of the stock on margin, there is a maintenance margin below which the margin is not allowed to fall. On the New York Stock Exchange, the maintenance margin is 25%, but brokers can set their own margins (30% is common). If the margin falls below the maintenance margin, the broker calls for additional cash from the investor. If the money does not come within the specified time, the broker immediately sells the stock.
Buying on margin is a technique that many investors use. It allows better utilization of available resources. But as the investor, you must be completely aware and positive about buying before you actually do so.