Short answer
No. Sleeping pills prescribed by a doctor, and supplements like melatonin, are allowed as treatment for insomnia. Sleep is not intoxication. What is not allowed is misusing them, taking them in a way that causes harm or dependency, or letting them make you miss Fajr without trying to wake. Check melatonin gummies and capsules for gelatin.
Medicine that brings sleep is permissible when used for a need at the right dose. Harmful misuse is forbidden. A prayer missed while asleep must be made up when one wakes, and a person should take reasonable means to wake for prayer.
The four schools agree on this.
Explanation
Allah made sleep a rest for people and one of His signs. Insomnia, shift work, jet lag and anxiety can all wreck sleep, and treating them is allowed like any other treatment. The Prophet ﷺ told people to seek treatment, saying Allah has sent down a cure for every disease.
Some people worry that a sleeping tablet is like an intoxicant. It is not. Intoxication means the mind is clouded while you are awake, the way alcohol does. A medicine that helps you sleep at the prescribed dose is treatment, and a short drowsy period is a side effect, not a high.
Points to watch:
- Prescription sedatives (such as zolpidem or benzodiazepines) can cause dependency. Use them only as prescribed and for as long as your doctor says.
- Melatonin is sold over the counter in the US and is prescription-only in the UK. Gummies and capsules sometimes contain gelatin; choose a halal or vegetarian form (see gelatin in medicine).
- Fajr. Set alarms or ask someone to wake you. If you sleep through a prayer despite trying, make it up as soon as you wake, as the Prophet ﷺ taught. If a medicine makes you miss Fajr regularly, ask your doctor about timing.
- Never take more than prescribed or mix sedatives with other drugs.
Sunnah habits also help sleep: sleeping early after Isha, wudu before bed, lying on the right side and the dua before sleeping. Follow a qualified doctor's advice on medicines.
Ask a mufti about your own case. This answer explains the general ruling. When the details of your situation matter, as they do here, ask a qualified mufti and give them the full facts. Where to ask a scholar.
The evidence
Quran, Surah An-Naba 78:9
وَجَعَلْنَا نَوْمَكُمْ سُبَاتًۭا ﴿٩﴾
And made your sleep [a means for] rest
Sleep is a blessing, and restoring it is a lawful aim.
Sahih al-Bukhari 5678
Sahih... ما أنزل الله داء إلا أنزل له شفاء ...
"Allah has not sent down any disease without sending down a cure for it."
Insomnia may be treated.
Sahih Muslim 684
Sahih... من نسي صلاة أو نام عنها فكفارتها أن يصليها إذا ذكرها ...
"Whoever forgets a prayer or sleeps through it, its expiation is to pray it when he remembers."
A prayer missed in sleep is made up on waking.
Where the ruling is recorded
- al-Fatawa al-Hindiyya, Kitab al-Karahiyya, chapter on treatment. Treatment with medicines is permitted.
- Radd al-Muhtar (Ibn Abidin), Kitab al-Ashriba, on banj. A non-intoxicating amount of a drug may be used as medicine.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.