Short answer
Yes, if your repentance is sincere each time. A sincere tawbah is accepted even if you later slip again, and then you repent again. What ruins a person is giving up on Allah's mercy, or making peace with the sin, not falling and getting back up.
Each repentance that meets its conditions at the time is valid, and a later relapse does not cancel it; the new sin needs a new repentance. Persisting in a sin without regret turns even a minor sin into a major one.
The four schools agree on this.
Explanation
The Prophet ﷺ described a servant who sinned and said, "My Lord, forgive me." Allah said: "My servant knew he has a Lord who forgives sin and takes to account for it. I have forgiven My servant." The servant sinned again and repented again, and again Allah forgave him, a third time and more. The hadith is in al-Bukhari, and scholars use it to show that relapse does not close the door.
There is a difference between relapsing and persisting. The Quran praises those who, when they sin, remember Allah, ask forgiveness "and do not persist in what they have done while they know" (3:135). Persisting means carrying on with no regret and no intention to stop. Relapsing means you truly meant to stop, and you fell. The first is dangerous; the second is human, and the cure is to repent again.
Some practical help for a sin that keeps coming back:
- Cut off what leads to it: certain apps, places, times or company.
- Follow the sin with a good deed, because good deeds wipe out bad ones (11:114).
- Keep the five prayers on time and add dhikr, especially in the moments you are most tempted.
- Do not tell others about it. Ask Allah in private to help you leave it.
Shaytan often says, "You keep doing it, so your repentance is fake, so stop praying." That voice is the real trap. Allah says do not despair of His mercy (39:53). See how to repent and Does Allah forgive all sins?
The evidence
Quran, Surah Aal-i-Imraan 3:135
وَٱلَّذِينَ إِذَا فَعَلُوا۟ فَٰحِشَةً أَوْ ظَلَمُوٓا۟ أَنفُسَهُمْ ذَكَرُوا۟ ٱللَّهَ فَٱسْتَغْفَرُوا۟ لِذُنُوبِهِمْ وَمَن يَغْفِرُ ٱلذُّنُوبَ إِلَّا ٱللَّهُ وَلَمْ يُصِرُّوا۟ عَلَىٰ مَا فَعَلُوا۟ وَهُمْ يَعْلَمُونَ ﴿١٣٥﴾
And those who, when they commit an immorality or wrong themselves [by transgression], remember Allah and seek forgiveness for their sins - and who can forgive sins except Allah? - and [who] do not persist in what they have done while they know.
Praises those who seek forgiveness and do not persist in sin.
Quran, Surah Hud 11:114
وَأَقِمِ ٱلصَّلَوٰةَ طَرَفَىِ ٱلنَّهَارِ وَزُلَفًۭا مِّنَ ٱلَّيْلِ ۚ إِنَّ ٱلْحَسَنَٰتِ يُذْهِبْنَ ٱلسَّيِّـَٔاتِ ۚ ذَٰلِكَ ذِكْرَىٰ لِلذَّٰكِرِينَ ﴿١١٤﴾
And establish prayer at the two ends of the day and at the approach of the night. Indeed, good deeds do away with misdeeds. That is a reminder for those who remember.
Good deeds wipe out bad deeds.
Quran, Surah Az-Zumar 39:53
۞ قُلْ يَٰعِبَادِىَ ٱلَّذِينَ أَسْرَفُوا۟ عَلَىٰٓ أَنفُسِهِمْ لَا تَقْنَطُوا۟ مِن رَّحْمَةِ ٱللَّهِ ۚ إِنَّ ٱللَّهَ يَغْفِرُ ٱلذُّنُوبَ جَمِيعًا ۚ إِنَّهُۥ هُوَ ٱلْغَفُورُ ٱلرَّحِيمُ ﴿٥٣﴾
Say, "O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allah. Indeed, Allah forgives all sins. Indeed, it is He who is the Forgiving, the Merciful."
Forbids despair of Allah's mercy.
Sahih al-Bukhari 7507
Sahih... عَلِمَ عَبْدِي أَنَّ لَهُ رَبًّا يَغْفِرُ الذَّنْبَ وَيَأْخُذُ بِهِ ...
"My servant knew that he has a Lord who forgives sin and takes to account for it; I have forgiven My servant."
Allah forgives a servant who repents each time he sins.
Where the ruling is recorded
- Riyad al-Salihin (al-Nawawi), Chapter on repentance. Explains that repentance is valid even if the sin is repeated, and each sin needs its own repentance.
- Ihya Ulum al-Din (al-Ghazali), Kitab al-Tawbah. Discusses relapse after repentance and how persistence turns minor sins into major ones.
This answer is pending review by the scholars on our team. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.