Is mastrubation is halal or haram in Islam?

Masturbation is Haraam (unlawful).

This is the ruling of the four Madhaahibs viz. Maliki, Shafée, Hanafee and
one riwaayah (narration) from Imaam Hanbalee. They have drawn their
conclusions from the following proofs:

PROOFS FROM THE QURÃN
* Allah Taãla says:
‘And those who guard their private parts from their wives and those
(slave-girls) which their right-hands own – so there is no blame upon them.
Then whoever seeks beyond that (which is lawful), they are the
transgressors.

The intended meaning of these Aayat is clear. Allah Taãla has praised the
believers for guarding their private parts from that which He has made
forbidden for them. Allah has permitted them to approach their wives and
slave-girls. Thereafter, these words of Allah Taãla follow: ‘Whoever seeks
beyond that which is lawful are oppressors who overstep from Halaal
(permitted) towards Haraam (prohibited).

Hafiz ibn Katheer (RA) writes Imaam Shaafée (RA) and those who have agreed
with him have concluded that masturbation is Haraam from this Aayat.’ He
says: ‘Masturbation is excluded from these two types which Allah has made
Halaal, viz. wives and slave-girls.

* Similarly, these Fuqahaa (Jurists) have drawn their conclusion from the
following Aayat:
‘And those who do not find the means to marry should remain chaste until
Allah gives them resources by His grace.’

This Aayat shows masturbation to be Haraam because of two reasons: Firstly,
in this Aayat Allah Taãla has given the command of chastity and, according
to the principles of Fiqh, a command (an imperative) denotes Wujoob
(incumbency, obligation). Hence to remain chaste is Waajib (compulsory) and
wherever chastity is Waajib it becomes Waajib to refrain from that which is
contrary to it, for example, adultery, fornication, and sodomy. This is due
to the fact that obligatory chastity will not materialise except by complete
refrainment from all that which is contrary to chastity.
Secondly: in this Aayat, Allah Taãla has made chastity obligatory on those
who are unable to execute the command of Nikah. Here Allah Taãla has not
determined any connection or link between marriage and chastity. Hence, this
demands that masturbation should be Haraam. And if assuming, it was
permissible, then Allah Taãla would have mentioned it at this point because
this was the place of explanation. The silence maintaned by Allah Taãla with
regard to it at a place which requires its explanation, denotes that
masturbation is Haraam.

Imaam Qurtubi (RA) has written in the Tafseer of this Aayat: ‘And when Allah
Taãla has not determined any order between Nikah and chastity, then this
shows that besides these two, everything else is Haraam. However, this
Hurmat (unlawfulness) does not include slave-girls because another command
of the Qurãn makes them Mubaah (permissible), viz.
‘That which the right-hands earn (i.e. slave-girls).’ Hence, in this manner
an addition of slave-girl has come. Masturbation, however still remains
Haraam.
‘Those who seek beyond this (i.e. wives and slave-girls) are transgressors.’
(Maãrij 31)

Under the Tafseer of this Aayat, Qaadhi Thanaullah Paani Patti writes:
‘Imaam Baghawi has deduced from this Aayat that masturbation is Haraam.’

PROOFS FROM AHAADITH
* Similarly, the Fuqahaa have drawn their conclusion from a Hadith reported
by Abdullah bin Masóod (Radhiallaahu Ánhu) in Bukhari and Muslim. He reports
that Rasulullah (Sallallaahu Álayhi Wasallam) said, ‘O group of youth!
Whoever from among you can marry should do so because it keeps the gaze low
and it protects the private parts. And he who cannot marry should make it
compulsory upon himself to fast because it breaks lust.’
Nabi (Sallallaahu Álayhi Wasallam) directed the person who is incapable of
bearing the burden on Nikah towards Sawm (fasting). If assuming,
masturbation was permissible, Rasulullah (Sallallaahu Álayhi Wasallam) would
have mentioned it at this point. Rasulullah (Sallallaahu Álayhi Wasallam)
however maintained silence. Hence, this indicates that masturbation is
Haraam because silence at the place of explanation gives the benefit of
restriction.

* Some of the Fuqahaa have drawn their conclusion from a narration reported
by Hasan bin Arfah that Nabi (Sallallaahu Álayhi Wasallam) said, ‘Seven
persons are such that Allah will not look at them on the Day of Qiyaamat nor
will He purify them nor will He include them among the learned and Allah
will enter them into Jahannam. They will enter Jahannam first except for
those who repent. As those who repent Allah will accept their repentance.

1. A person who masturbates.
2. A person who performs the act of sodomy.
3. The person upon whom the act of sodomy is performed.
4. A perpetual drunkard.
5. The person who hits his parents so much that they appeal for help.
6. The person who harms his neighbours so much so that they curse him.
7. The person who commits adultery with his neighbour’s wife. (Ibn Katheer
vol. 5 p. 458)

Hadhrat Anas (Radhiallaahu Ánhu) narrates that Rasulullah (Sallallaahu
Álayhi Wasallam) said, ‘The person who performs Nikah with his hands (i.e.
masturbates) is cursed. (Tafseer Mazhari vol. 12 p. 94)

SAYINGS OF OUR PIOUS PREDECESSORS WITH REGARD TO MASTURBATION
* Saéed bin Jubayr (Radhiallaahu Ánhu) narrates that Rasulullah (Sallallaahu
Álayhi Wasallam) said, ‘Allah Taãla will inflict a punishment on a group of
people because they played with their private parts.’
* Attaa (RA) says, ‘Some people will be resurrected in such a condition that
their hands will be pregnant, I think they are those who masturbate.’

And Allah Taãla Knows Best.