Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
muslim:123c[Chain 1] Isḥāq b. Ibrāhīm And ʿAbd b. Ḥumayd > ʿAbd al-Razzāq > Maʿmar > al-Zuhrī Bihadhā al-Isnād [Chain 2] Isḥāq b. Ibrāhīm > Abū Muʿāwiyah > Hishām b. ʿUrwah from his father > Ḥakīm b. Ḥizām

I said: Messenger of Allah, I did so some of the deeds in the state of ignorance. (One of the transmitters Hisham b. Urwa explained them as acts of piety. Upon this the Messenger, of Allah remarked: You have embraced Islam with all the previous acts of virtue. I said: By God, I would leave nothing undone in Islam the like of which I did in the state of ignorance.  

مسلم:١٢٣cحَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ وَعَبْدُ بْنُ حُمَيْدٍ قَالاَ أَخْبَرَنَا عَبْدُ الرَّزَّاقِ أَخْبَرَنَا مَعْمَرٌ عَنِ الزُّهْرِيِّ بِهَذَا الإِسْنَادِ ح وَحَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ أَخْبَرَنَا أَبُو مُعَاوِيَةَ حَدَّثَنَا هِشَامُ بْنُ عُرْوَةَ عَنْ أَبِيهِ عَنْ حَكِيمِ بْنِ حِزَامٍ قَالَ

قُلْتُ يَا رَسُولَ اللَّهِ أَشْيَاءَ كُنْتُ أَفْعَلُهَا فِي الْجَاهِلِيَّةِ قَالَ هِشَامٌ يَعْنِي أَتَبَرَّرُ بِهَا فَقَالَ رَسُولُ اللَّهِ ﷺ أَسْلَمْتَ عَلَى مَا أَسْلَفْتَ لَكَ مِنَ الْخَيْرِ قُلْتُ فَوَاللَّهِ لاَ أَدَعُ شَيْئًا صَنَعْتُهُ فِي الْجَاهِلِيَّةِ إِلاَّ فَعَلْتُ فِي الإِسْلاَمِ مِثْلَهُ  


See similar narrations below:

Collected by Bukhārī, Ṭabarānī
bukhari:2538ʿUbayd b. Ismāʿīl > Abū Usāmah > Hishām from my father > Ḥakīm

My father told me that Hakim bin Hizam manumitted one-hundred slaves in the Pre-Islamic period of ignorance and slaughtered one-hundred camels (and distributed them in charity). When he embraced Islam he again slaughtered one-hundred camels and manumitted one-hundred slaves. Hakim said, "I asked Messenger of Allah ﷺ, 'O Messenger of Allah ﷺ! What do you think about some good deeds I used to practice in the Pre-Islamic period of ignorance regarding them as deeds of righteousness?' Allah's Apostle said, "You have embraced Islam along with all those good deeds you did."  

البخاري:٢٥٣٨حَدَّثَنَا عُبَيْدُ بْنُ إِسْمَاعِيلَ حَدَّثَنَا أَبُو أُسَامَةَ عَنْ هِشَامٍ أَخْبَرَنِي أَبِي أَنَّ حَكِيمَ بْنَ حِزَامٍ ؓ أَعْتَقَ فِي الْجَاهِلِيَّةِ مِائَةَ رَقَبَةٍ وَحَمَلَ عَلَى مِائَةِ بَعِيرٍ فَلَمَّا أَسْلَمَ حَمَلَ عَلَى مِائَةِ بَعِيرٍ وَأَعْتَقَ مِائَةَ رَقَبَةٍ قَالَ

فَسَأَلْتُ رَسُولَ اللَّهِ ﷺ فَقُلْتُ يَا رَسُولَ اللَّهِ أَرَأَيْتَ أَشْيَاءَ كُنْتُ أَصْنَعُهَا فِي الْجَاهِلِيَّةِ كُنْتُ أَتَحَنَّثُ بِهَا يَعْنِي أَتَبَرَّرُ بِهَا قَالَ فَقَالَ رَسُولُ اللَّهِ ﷺ أَسْلَمْتَ عَلَى مَا سَلَفَ لَكَ مِنْ خَيْرٍ  

tabarani:3085al-Ḥusayn b. Isḥāq al-Tustarī > ʿUthmān b. Abū Shaybah > ʿAbdah b. Sulaymān > Hishām b. ʿUrwah from his father > Ḥakīm b. Ḥizām

[Machine] I asked, "O Messenger of Allah, what do you think about the things I used to do during the time of ignorance (before Islam)? Can I justify them?" The Messenger of Allah ﷺ said, "You have embraced Islam and all the previous good deeds (before Islam) count." Hisham said, "He (the Messenger of Allah) used to free slaves even during the time of ignorance."  

الطبراني:٣٠٨٥حَدَّثَنَا الْحُسَيْنُ بْنُ إِسْحَاقَ التُّسْتَرِيُّ ثنا عُثْمَانُ بْنُ أَبِي شَيْبَةَ ثنا عَبْدَةُ بْنُ سُلَيْمَانَ عَنْ هِشَامِ بْنِ عُرْوَةَ عَنْ أَبِيهِ عَنْ حَكِيمِ بْنِ حِزَامٍ قَالَ

قُلْتُ يَا رَسُولَ اللهِ أَرَأَيْتَ أَشْيَاءَ كُنْتُ أَصْنَعُهَا فِي الْجَاهِلِيَّةِ أَتَبَرَّرُ بِهَا؟ فَقَالَ رَسُولُ اللهِ ﷺ «أَسْلَمْتَ عَلَى مَا سَلَفَ مِنْ خَيْرٍ» قَالَ هِشَامٌ «وَكَانَ أَعْتَقَ فِي الْجَاهِلِيَّةِ»