The masjid is described in the hadith as 'the most beloved places to Allah' (Sahih Muslim 671). Entering it carries adab — etiquette — that the Prophet ﷺ taught with two short duas: one as you cross the threshold in, one as you step out. They take ten seconds and transform a routine prayer visit into worship from doorstep to doorstep.
The dua when entering the masjid
اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ
Allahumma-ftah li abwaba rahmatik.
O Allah, open for me the gates of Your mercy.
(Sahih Muslim 713 — narrated by Abu Humayd / Abu Usayd (RA))
The dua when leaving the masjid
اللَّهُمَّ إِنِّي أَسْأَلُكَ مِنْ فَضْلِكَ
Allahumma inni as'aluka min fadlik.
O Allah, I ask You of Your bounty.
(Sahih Muslim 713 — narrated by Abu Humayd / Abu Usayd (RA))
The method — which foot first?
- Enter the masjid with your right foot first (the Prophet ﷺ loved beginning everything good with the right).
- Recite the entering dua as you cross the threshold.
- Leave with your left foot first.
- Recite the leaving dua as you step out.
- Send salawat on the Prophet ﷺ as you enter — narrated in Ibn Majah (771) on the authority of Fatimah bint Rasulullah ﷺ.
Why the asymmetry — mercy versus bounty
Notice the Prophet ﷺ asked for mercy (rahmah) on entering, and bounty (fadl) on leaving. Inside the masjid we are in a place of worship — we ask for the most spiritual gift. As we step out into the world of work and trade, we ask for the gift that sustains us in that world. The duas teach the believer how to balance the two halves of life.
What to do once inside
The Prophet ﷺ taught that no one should sit down in the masjid until they pray two short rak'ahs — Tahiyyat al-Masjid (the greeting of the masjid) (Sahih al-Bukhari 1163). Even during the khutbah of Jumu'ah, those entering should pray two brief rak'ahs and then sit (Sahih Muslim 875).
Hadith reference
Both duas are in Sahih Muslim (713) on the authority of Abu Humayd or Abu Usayd as-Sa'idi (RA). Other narrators (Ibn Majah, Abu Dawud) record additional wordings, but this short version is the most authentic and most universally taught.