Is Buying Shares Halal?
Question

What is the ruling on buying and selling shares? Please note that some scholars regard shares from all companies as haram.
Praise be to Allah.Types of shares
Shares may be divided, according to the field of activity and work involved, into three categories: 

Shares based on permissible work, such as companies that deal with transportation, shipping, manufacturing clothing, tools, office supplies, furniture, medical equipment, real estate, and so on, and do not engage in any haram practices or transactions, such as cheating, or lending or borrowing on the basis of riba; rather they follow Islamic rulings in all their transactions and dealings. 

These types of companies are called “permissible” or “clean” companies, and it is permissible to buy and sell shares in them. 

Shares based on prohibited types of work, such as companies that deal with tourism, hotels that promote and aid in immoral actions, breweries, riba-based banks, commercial insurance companies, companies that print and distribute indecent magazines, and so on. It is not permissible to buy shares or invest in this type of company, and it is not permissible to advertise them or promote them. 

With regard to these two types of companies, there is no confusion about the ruling and the matter is quite clear. 

Companies whose field of work is basically permissible, but they engage in some haram practices or transactions, such as transportation companies – for example – that have interest-bearing accounts in the bank, or they are financed by means of riba-based loans from banks or from people in the form of stocks. 

These types of companies are called “mixed” companies. The contemporary scholars differed concerning the ruling on them, but the most correct view is that it is haram to buy shares in them, invest in them or promote them. 
That is because the shareholder is a partner in the company based on the number of shares he holds, so he is a partner to every transaction into which the company enters, such as riba or other haram transactions. 
With regard to the prohibition on promoting these companies, that is because of what that involves of co-operating in sin and transgression, helping to spread haram and causing people to fall into it. Allah, may He be exalted, says (interpretation of the meaning):
“Help you one another in Al-Birr and At-Taqwa (virtue, righteousness and piety); but do not help one another in sin and transgression” [al-Maidah 5:2]. 
This view was favoured by the majority of contemporary scholars, including the scholars of the Standing Committee for Issuing Fatwas in the land of the two Holy Sanctuaries. A statement to that effect was also issued by the Islamic Fiqh Council belonging to the Organization of the Islamic Conference, as well as the Islamic Fiqh Council belonging to the Muslim World League. 
It says in Fatawa al-Lajnah ad-Daimah, 14/299: 
“The basic principle is that it is permissible to hold shares in any company if it does not deal with haram things such as riba and so on. But if it does deal with haram things such as riba, then it is not permissible to hold shares in it. 
Based on that, if any of the shares mentioned are in a company that deals with riba or haram things, then it is essential to withdraw from it and get rid of any profit by giving it to the poor and needy.”  (Shaykh ‘Abd al-‘Aziz ibn ‘Abdullah ibn Baz, Shaykh ‘Abd ar-Razzaq ‘Afifi, Shaykh ‘Abdullah ibn Ghadyyan, Shaykh Salih al-Fawzan, Shaykh ‘Abd al-‘Aziz Al ash-Shaykh, Shaykh Bakr Abu Zayd) 
It also says (14/299, 300): 
“Firstly: if it is proven that a company deals in riba , whether taking or giving, it is haram to hold shares in it, because that comes under the heading of helping in sin and transgression. Allah, may He be exalted, says (interpretation of the meaning):
“Help you one another in Al-Birr and At-Taqwa (virtue, righteousness and piety); but do not help one another in sin and transgression. And fear Allah. Verily, Allah is Severe in punishment” [al-Maidah 5:2]. 
Secondly: if a person previously acquired shares in a company that deals in riba, then he has to sell his shares in it and spend the interest on charitable causes.” (Shaykh ‘Abd al-‘Aziz ibn ‘Abdullah ibn Baz, Shaykh ‘Abd ar-Razzaq ‘Afifi, Shaykh ‘Abdullah ibn Ghadyyan, Shaykh ‘Abdullah ibn Qa‘ud) 
Statement of the Organization of the Islamic Conference on shares
The Islamic Fiqh Council belonging to the Organization of the Islamic Conference issued a statement concerning shares in its seventh conference, held in Jeddah, 7-12 Dhu’l-Qa‘dah 1412 AH/ 9-14 May 1992 CE, in which it says: 

As the basic principle concerning transactions is that they are permissible, founding a share-based company that has Islamically acceptable aims and activities is something that is permissible. 


There is no difference of opinion concerning the prohibition on holding shares in companies whose basic aims are haram, such as dealing in riba, or producing or trading in haram things. 


The basic principle is that it is haram to hold shares in companies that sometimes deal in haram things, such as riba and so on, despite the fact that their basic activities are Islamically acceptable.” (Majallat al-Majma‘, issue no. 6, vol. 2, p. 1273; issue no. 7, vol. 1, p. 73; issue no. 9, vol. 2, p. 5) 

Statement of the Islamic Fiqh Council of the Muslim World League on shares
The Islamic Fiqh Council of the Muslim World League issued a statement on the same matter in its fourteenth session in 1415 AH/1985 CE, the text of which is as follows: 

“As the basic principle concerning transactions is that they are permissible, founding a share-based company that has Islamically acceptable aims and activities is something that is permissible. 
There is no difference of opinion concerning the prohibition on holding shares in companies whose basic aims are haram, such as dealing in riba, or manufacturing or trading in haram things.
It is not permissible for a Muslim to buy shares in companies or banks if some of their transactions involve dealing in riba, or manufacturing or trading in haram things.
If an individual purchased shares not knowing that the company deals in riba, then he finds out about that, what he must do is get out of it. 

The prohibition in this case is clear because of the general meaning of the evidence in the Quran and Sunnah concerning the prohibition on riba, and because buying shares in companies that deal with riba when the purchaser is aware of that means that the purchaser himself is a partner in dealing in riba, because the share represents part of the company’s capital, and the shareholder has a share in the company’s activities and possessions. So if the company lends any money with interest, or borrows with interest, the shareholder has a share of that, because those who deal with lending and borrowing on the basis of interest are doing that on his behalf and acting as his delegate, and delegating someone else to do a haram action is not permissible. 
May Allah send blessings and peace upon our Prophet Muhammad and upon his family and companions. Praise be to Allah the Lord of the Worlds.” 
Dr. Muhammad ibn Sa‘ud al-‘Usaymi (may Allah preserve him) was asked about the ruling on investing in mixed shares. 
He replied: “It is not permissible according to the majority of scholars, except investing in “clean” shares, whether one is buying shares or investing .” 
Are all shares in all types of companies haram?
With regard to the view that shares in all types of companies are haram, this view is incorrect, because there are some companies of the first type, which are the ones that adhere to Islamic rulings in their dealings. But perhaps those who are of this view were motivated to say that because companies of the first type are very few and most companies are of the second and third types. 
And Allah knows best.