Can good deeds erase bad deeds?

Yes, good deeds can erase bad deeds in Islam, especially minor sins. The Quran says so directly, and the Prophet ﷺ told us to follow a bad deed with a good one. Major sins need sincere repentance as well, and wrongs against other people also need to be put right with them.
What the Quran says
This verse was revealed after a man came to the Prophet ﷺ, ashamed that he had kissed a woman he wasn't married to. The verse told him that prayer and good deeds wipe away such sins, and the Prophet ﷺ said it applies to all of his community who act on it (Sahih al-Bukhari 526). Allah even promises that for those who repent, believe and do good, He will replace their bad deeds with good ones (Quran 25:70).
What the Prophet ﷺ taught
He gave this simple advice: "Fear Allah wherever you are, follow a bad deed with a good deed and it will wipe it out, and treat people with good character" (Jami' at-Tirmidhi 1987).
He also said that the five daily prayers, Friday to Friday, and Ramadan to Ramadan wipe out the sins between them, as long as major sins are avoided (Sahih Muslim 233). So your ordinary worship is constantly cleaning your record.
Minor sins vs major sins
- Minor sins (a harsh word, a careless glance, small lapses): most scholars say good deeds like prayer, wudu, charity and dhikr erase them, even without a specific repentance for each one.
- Major sins (like drinking, zina, stealing or abandoning prayer): the majority of scholars say these need tawbah, which means stopping, regretting and intending not to return. Good deeds still help, but they don't replace repentance. See Will Allah forgive me if I keep committing the same sin?
- Wrongs against people (debts, stolen things, hurtful lies): these need to be returned or forgiven by the person. The Prophet ﷺ urged anyone who has wronged someone to settle it today, before a day when there is no money, only good and bad deeds (Sahih al-Bukhari 2449).
Small deeds count more than you think
You don't need grand gestures. Saying astaghfirullah, smiling at someone, helping a neighbour or giving a coin in charity are all good deeds that weigh on your scale. See Is a smile really charity in Islam?
And don't let a bad deed convince you that you're "too far gone". The whole point of this teaching is that the door stays open. See How do I let go of guilt from my life before Islam?
- Quran 11:114: good deeds do away with bad deeds.
- Prayer, Jumu'ah and Ramadan wipe out minor sins.
- Major sins also need sincere repentance.
- Wrongs against people must be put right with them.
People also ask
What is a shaheed in Islam?
A shaheed is a martyr: a Muslim who dies a death Allah honours, from defending others to plague, drowning or childbirth. Here is what it means.
Read the full answer →What does Islam say about near-death experiences?
Islam doesn't mention near-death experiences directly. The person didn't truly die, so what they saw isn't a reliable view of the afterlife.
Read the full answer →What is the book of deeds in Islam?
The book of deeds is the angels' record of everything you did and said, given in the right or left hand on the Day of Judgement.
Read the full answer →What is the trumpet on the Day of Judgement?
The trumpet (as-Sur) is a horn an angel, commonly named Israfil, will blow to end the world and then raise everyone for the Day of Judgement.
Read the full answer →When will the Day of Judgement happen?
No one knows when the Day of Judgement will happen except Allah. Islam teaches it comes suddenly, on a Friday, after major signs.
Read the full answer →