The dua for entering and leaving the masjid

Enter asking for mercy, leave asking for bounty.

Narrated by Abu Humaid or Abu Usaid

When one of you enters the masjid, let him say: "Allahumma-ftah li abwaba rahmatik" (O Allah, open for me the doors of Your mercy). And when he leaves, let him say: "Allahumma inni as'aluka min fadlik" (O Allah, I ask You of Your bounty).

Sahih Muslim 713

What this hadith teaches

A two-line habit that turns every visit to the masjid into dua.

Reference and grade

Grade
Sahih (in Sahih Muslim)
Narrator
Abu Humaid or Abu Usaid
Chapter
The masjid

The hadith in Arabic نص الحديث

اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ‏.‏ وَإِذَا خَرَجَ فَلْيَقُلِ اللَّهُمَّ إِنِّي أَسْأَلُكَ مِنْ فَضْلِكَ

Arabic text of Sahih Muslim 713, as given on sunnah.com.