Every step raises a rank

Walking to the masjid only for prayer: each step raises a rank and removes a sin.

Narrated by Abu Hurairah

When one of you makes wudu well and goes out to the masjid, nothing taking him out but the prayer, he does not take a step except that he is raised a rank by it and a sin is removed. When he prays, the angels keep sending blessings on him as long as he stays in his place of prayer.

Sahih al-Bukhari 647, Sahih Muslim 649

What this hadith teaches

The intention matters: going out only for the prayer turns the whole walk into worship.

Reference and grade

Grade
Sahih: agreed upon by al-Bukhari and Muslim
Narrator
Abu Hurairah
Chapter
The masjid

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

صَلاَةُ الرَّجُلِ فِي الْجَمَاعَةِ تُضَعَّفُ عَلَى صَلاَتِهِ فِي بَيْتِهِ وَفِي سُوقِهِ خَمْسًا وَعِشْرِينَ ضِعْفًا، وَذَلِكَ أَنَّهُ إِذَا تَوَضَّأَ فَأَحْسَنَ الْوُضُوءَ، ثُمَّ خَرَجَ إِلَى الْمَسْجِدِ لاَ يُخْرِجُهُ إِلاَّ الصَّلاَةُ، لَمْ يَخْطُ خَطْوَةً إِلاَّ رُفِعَتْ لَهُ بِهَا دَرَجَةٌ، وَحُطَّ عَنْهُ بِهَا خَطِيئَةٌ، فَإِذَا صَلَّى لَمْ تَزَلِ الْمَلاَئِكَةُ تُصَلِّي عَلَيْهِ مَا دَامَ فِي مُصَلاَّهُ اللَّهُمَّ صَلِّ عَلَيْهِ، اللَّهُمَّ ارْحَمْهُ‏.‏ وَلاَ يَزَالُ أَحَدُكُمْ فِي صَلاَةٍ مَا انْتَظَرَ الصَّلاَةَ

Arabic text of Sahih al-Bukhari 647, as given on sunnah.com.