Dua for Entering the Mosque
أَعُوذُ بِاللَّهِ الْعَظِيمِ وَبِوَجْهِهِ الْكَرِيمِ وَسُلْطَانِهِ الْقَدِيمِ مِنَ الشَّيْطَانِ الرَّجِيمِ، بِسْمِ اللَّهِ، وَالصَّلَاةُ وَالسَّلَامُ عَلَى رَسُولِ اللَّهِ، اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ
A'udhu billahil-'Adhim, wa bi-wajhihil-Karim, wa sultanihil-qadim, minash-Shaytanir-rajim. Bismillah, was-salatu was-salamu 'ala Rasulillah. Allahummaftah li abwaba rahmatik.
I seek refuge in Allah the Mighty, and in His Noble Face, and in His eternal authority, from Shaytan the accursed. In the name of Allah, and peace and blessings be upon the Messenger of Allah. O Allah, open for me the doors of Your mercy.
Source: Sunan Abi Dawud 466, Sahih Muslim 713
When to say this dua
Enter with your right foot, saying this dua. On leaving (left foot first), end instead with: 'Allahumma inni as'aluka min fadlik' — 'O Allah, I ask You of Your bounty' (Sahih Muslim 713).
Good to know
The first sentence is from Sunan Abi Dawud 466; the closing request for mercy on entering — and bounty on leaving — is from Sahih Muslim 713.