The Messenger of Allah ﷺ said, "Prayer in congregation is superior to the prayer of a person praying alone by twenty-seven degrees."
حدثنا هناد حدثنا عبدة عن عبيد الله بن عمر عن نافع
قال رسول الله ﷺ صلاة الجماعة تفضل على صلاة الرجل وحده بسبع وعشرين درجة
Agreed upon [by Bukhari and Muslim]. Muslim narrated it in the Book of Mosques, chapter on the excellence of praying in congregation, etc., no. 650, from the hadith of Ubaydullah bin Umar, and Bukhari, in the Book of Adhan, chapter on the excellence of praying in congregation, etc., no. 645, from the hadith of Nafi with the same wording.On this subject there are also narrations from Abdullah bin Masud [Muslim, no. 654, and Ahmad, 1/376], Ubayy bin Kaab [Ibn Majah, no. 790], Muaz bin Jabal [see Majma al-Zawaid, 2/39], Abu Saeed [Bukhari, no. 646], Abu Hurairah [coming up, 216], and Anas bin Malik [see Majma al-Zawaid, 2/38].