If some hadiths are combined, the Dua for going out the mosque will be as follows:
بِسْمِ اللَّهِ اَللَّهُمَّ صَلِّ عَلَى مُحَمَّدٍ، اَللَّهُمَّ إِنِّيْ أَسْأَلُكَ مِنْ فَضْلِكَ
Pronunciation
Bismillahi Allaahumma salli 'ala muhammad, Allaahumma inni as-aluka min fadlik
Meaning
In the name of Allah (I am going out).Oh Allah! Please send bessings and peace upon muhammad (ﷺ). Oh Allah! I want from your bounty.
Source: Hasan (Albani). Ibn Sunni: 88, Muslim: 713
Read the hadith
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى، أَخْبَرَنَا سُلَيْمَانُ بْنُ بِلاَلٍ، عَنْ رَبِيعَةَ بْنِ أَبِي عَبْدِ الرَّحْمَنِ، عَنْ عَبْدِ الْمَلِكِ بْنِ سَعِيدٍ، عَنْ أَبِي حُمَيْدٍ، - أَوْ عَنْ أَبِي أُسَيْدٍ، - قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيَقُلِ اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ . وَإِذَا خَرَجَ فَلْيَقُلِ اللَّهُمَّ إِنِّي أَسْأَلُكَ مِنْ فَضْلِكَ " . قَالَ مُسْلِمٌ سَمِعْتُ يَحْيَى بْنَ يَحْيَى يَقُولُ كَتَبْتُ هَذَا الْحَدِيثَ مِنْ كِتَابِ سُلَيْمَانَ بْنِ بِلاَلٍ . قَالَ بَلَغَنِي أَنَّ يَحْيَى الْحِمَّانِيَّ يَقُولُ وَأَبِي أُسَيْدٍ .
Abu Usaid reported that the Messenger of Allah (ﷺ) said: When any one of you enters the mosque, he should say: " O Allah! open for me the doors of Thy mercy" ; and when he steps out he should say: 'O Allah! I beg of Thee Thy Grace." (Imam Muslim said: I heard Yahya saying: I transcribed this hadith from the compilation of Sulaiman b. Bilal.) Sahih Muslim 713a [Hasan (Albani). Ibn Sunni: 88, Muslim: 713]
Duas from IslamicAPI's Masnun Dua dataset (based on the Quran, hadith, Hisnul Muslim and Rahe Belayat). See the dataset