Most contemporary scholars permit buying shares in companies whose main business is lawful, with conditions. Shares in companies whose main business is haram (alcohol, interest-based banks) are forbidden. Scholars differ about companies that are mostly lawful but have a small amount of interest income, and about margin buying and short selling, which most forbid. Check the company and ask a scholar.
This is general information, not a fatwa. For your own situation, ask a qualified scholar.
Questions about halal and haram
Is trading in stocks halal?
Most contemporary scholars permit buying shares in companies whose main business is lawful, with conditions. Shares in companies whose main business is haram (alcohol, interest-based banks) are forbidden. Scholars differ about companies that are mostly lawful but have a small amount of interest income, and about margin buying and short selling, which most forbid. Check the company and ask a scholar.