Short answer
No. In the Hanafi school, facing the qiblah or turning your back to it while urinating or passing stool is makruh tahrimi, both outdoors and inside a building. If your toilet faces the qiblah, sit turned to one side. The Shafi'i, Maliki and Hanbali schools allow it inside buildings and forbid it only in the open.
Facing the qiblah or putting your back to it while relieving yourself is makruh tahrimi, indoors and outdoors. It is also disliked to seat a small child facing it to relieve itself. When building a home, toilets should be placed so that they do not face the qiblah or away from it.
Other madhhabs
- Shafi'i
- Haram in the open without a screen, but allowed inside a building or behind a screen, though avoiding it is better.
- Maliki
- Forbidden in the open; allowed inside buildings and enclosed toilets.
- Hanbali
- Forbidden in the open; allowed inside buildings in the relied view.
Explanation
The Prophet ﷺ said that when you go to relieve yourself, do not face the qiblah or turn your back to it, but face east or west (said to the people of Madinah, for whom the qiblah is south). Ibn Umar once saw him on a rooftop relieving himself facing Syria with his back to the Kaaba. The other three schools take that as an exception for buildings. The Hanafi school holds to the general command: a clear prohibition in the Prophet's ﷺ words takes precedence over one glimpse of his practice, which may have had a reason. So it applies the ruling everywhere.
In practice, for a Hanafi:
- Your toilet faces the qiblah or away from it: sit angled to one side, so that your front and back are clearly turned away. Moving the toilet when you renovate is better.
- Building or buying a home: ask for toilets set at right angles to the qiblah. A qiblah finder helps.
- Out camping: pick a direction across the qiblah.
- You forgot and only noticed halfway: turn if you can. There is no sin for forgetting.
- Showering or changing: the ruling is about relieving yourself. Some Hanafi scholars also dislike facing the qiblah while uncovered, out of respect, but that is lighter.
Stretching your legs towards the qiblah when sitting or sleeping is also disliked, lightly, out of respect. For the other toilet manners, see istinja and talking in the bathroom.
The evidence
Sahih al-Bukhari 144
Sahih... اذا اتى احدكم الغائط فلا يستقبل القبلة ولا يولها ظهره ...
"When one of you goes to relieve himself, he should not face the qiblah or turn his back to it."
The general prohibition the Hanafi school applies indoors and outdoors.
Where the ruling is recorded
- al-Durr al-Mukhtar with Radd al-Muhtar, Kitab al-Taharah, chapter on istinja, makruhat. Facing or turning one's back to the qiblah while relieving oneself is makruh tahrimi even in buildings.
- al-Hidaya, Kitab al-Taharat, chapter on istinja. The prohibition of facing the qiblah while relieving oneself.
- al-Majmu' (Nawawi), Kitab al-Taharah, manners of relieving oneself. The Shafi'i distinction between the open and buildings.
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.