Narrated by Anas (RA) in Sahih al-Bukhari and Muslim, the Prophet ﷺ used to say upon entering the restroom: “O Allah, I seek refuge in You from male and female devils.” Scholars explain that jinn can see humans while humans cannot see them, hence the importance of this invocation.
Purpose of the Prayer:
The Prophet ﷺ guided believers to invoke Allah’s name when entering the restroom to ensure modesty and protection. Saying “Bismillah” while disrobing or changing clothes shields one’s private parts from the gaze of unseen beings. Ali (RA) reported: "The privacy between humans and jinn is preserved if one says ‘Bismillah’ upon entering the restroom."
Benefits of Mentioning Allah:
Protection from evil and jinn comes through remembering Allah. Uttering His name is the best form of safeguarding oneself, supported by the Quran: “Indeed, He sees you and His tribe unseen.” The recommended invocation is: “O Allah, I seek refuge in You from male and female devils.”
Fiqh References:
-
Al-Shirazi in Al-Tanbih: It is recommended to enter with the left foot first and exit with the right while reciting the prayer.
-
Ibn Qudamah: Advises saying “Bismillah” and “O Allah, I seek refuge in You from male and female devils and from all evil”.



