Short answer
No. Reciting the Quran in a toilet or bathroom is makruh tahrimi (seriously disliked) in the Hanafi school, and so is saying dhikr aloud there. Thinking of it in your heart is fine. A phone with a Quran app may go in if the app is closed and the phone is in your pocket.
Reciting the Quran, or saying dhikr with the tongue, in the place where one relieves oneself is makruh tahrimi. Entering with an ayah or Allah's name written on something uncovered is makruh; if it is in a pocket, case or bag, it is allowed.
The four schools agree on this.
Explanation
A man greeted the Prophet ﷺ while he was relieving himself and he did not return the greeting. In another report he returned it only after making wudu and said he disliked mentioning Allah except in a state of purity. If returning a greeting, which contains Allah's name, was held back in that place, reciting His book there is more serious still. The four schools agree it is to be avoided, and differ only on how strongly.
Many homes have one room for the toilet and the shower. The scholars treat the whole room as a place of relieving oneself, so avoid reciting there even while showering. Say the dua for entering the bathroom before you step inside, not after.
- Phone: close the Quran app and keep the phone in your pocket. A screen showing an ayah should not be open in there.
- Audio: pause recitation before you go in.
- Jewellery with Allah's name or an ayah: take it off, or keep it covered, for example turned inward in a closed hand or under a sleeve.
- Memorised Quran: what is in your heart is not a written copy, so there is no problem carrying it; just do not recite it with your tongue there.
For phones with ayat on the lock screen, see Quran verses as a phone wallpaper.
The evidence
Sahih Muslim 370
Sahih... أن رجلا مر ورسول الله صلى الله عليه وسلم يبول فسلم فلم يرد عليه ...
"A man passed by while the Messenger of Allah was urinating and greeted him, and he did not return the greeting."
Shows that words containing Allah's name are held back in the place of relieving oneself.
Sunan Abi Dawud 17
Graded sahih... إني كرهت أن أذكر الله عز وجل إلا على طهر ...
"I disliked mentioning Allah, Mighty and Majestic, except in a state of purity."
The reason he gave, which the jurists extend to the recitation of the Quran.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Taharah, chapter on istinja and the manners of relieving oneself. Reciting and verbal dhikr in the toilet are disliked, and entering with something bearing Allah's name uncovered is disliked.
- Nur al-Idah with Maraqi al-Falah, Chapter on istinja. Lists speaking and dhikr among the disliked acts in the toilet.
This answer is pending review by the scholars on our team. 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.