Dua for Entering and Leaving the Mosque
اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ
Transliteration: Allahummaftah li abwaba rahmatik.
Translation: O Allah, open for me the gates of Your mercy.
Source: Sahih Muslim 713
When to recite: When entering the masjid, stepping in with the right foot; and the second dua when leaving, stepping out with the left foot. This is the Sunnah in a hadith of Anas, graded hasan by al-Albani (as-Silsilah as-Sahihah 2478).