عَنْ أَنَسِ بْنِ مَالِكٍ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْت رَسُولَ اللَّهِ صلى الله عليه و سلم يَقُولُ: قَالَ اللَّهُ تَعَالَى: يَا ابْنَ آدَمَ! إِنَّكَ مَا دَعَوْتنِي وَرَجَوْتنِي غَفَرْتُ لَك عَلَى مَا كَانَ مِنْك وَلَا أُبَالِي، يَا ابْنَ آدَمَ! لَوْ بَلَغَتْ ذُنُوبُك عَنَانَ السَّمَاءِ ثُمَّ اسْتَغْفَرْتنِي غَفَرْتُ لَك، يَا ابْنَ آدَمَ! إنَّك لَوْ أتَيْتنِي بِقُرَابِ الْأَرْضِ خَطَايَا ثُمَّ لَقِيتنِي لَا تُشْرِكُ بِي شَيْئًا لَأَتَيْتُك بِقُرَابِهَا مَغْفِرَةً
Meaning: I heard the Messenger of Allah ﷺ say: Allah the Exalted said: O son of Adam, as long as you call on Me and hope in Me, I will forgive you whatever is in you, and I do not mind. O son of Adam, if your sins reached the clouds of the sky and you then asked Me for forgiveness, I would forgive you. O son of Adam, if you came to Me with nearly the earth's fill of sins and then met Me without associating anything with Me, I would come to you with nearly its fill of forgiveness.
An-Nawawi quotes at-Tirmidhi as hasan sahih, Ibn Rajab quotes him as hasan gharib, and the Tirmidhi text we checked says only gharib. Ibn Rajab: its chain is acceptable. Al-Albani: sahih in the Sunan at-Tirmidhi grading and hasan in Sahih al-Jami 4338. Shu'ayb al-Arna'ut: hasan. Bashar Awad Ma'ruf: hasan. A hadith qudsi.
Narrated by Anas ibn Malik · Jami' at-Tirmidhi 3540