How to repent in Islam comes down to a few steps: we stop the sin, regret it, resolve not to return to it and ask Allah's forgiveness. If it wronged another person, we put that right too. No one has to hear about it first. The Prophet ﷺ described a servant who sins, makes wudu, prays two rak'ahs and asks pardon, and said, "Allah pardons him" (Abu Bakr, Sunan Abi Dawud 1521).
In short
Repentance in Islam means stopping, regretting, resolving not to return and asking Allah's forgiveness, and putting right any wrong done to others. It needs no audience. Two rak'ahs after wudu are a Prophetic way to begin, and on days without prayer the du'a stays open.

Someone walks in and the thumb moves before we've decided anything. The screen tilts, and our voice comes out a little too normal. Nobody has accused us of anything, so what is the heart hurrying for?
How do we repent in Islam?
Repentance in Islam has three steps for a sin between us and Allah: leave the sin, regret it and firmly resolve not to return. A fourth applies when someone else was wronged. The Qur'an describes the people who get this right:
"And those who, when they commit an immorality or wrong themselves [by transgression], remember Allāh and seek forgiveness for their sins - and who can forgive sins except Allāh? - and [who] do not persist in what they have done while they know."
These conditions are widely attributed to Imam an-Nawawi's Riyad as-Salihin1. The texts here give no required formula of words, and any language will do. The plain name of the thing, said to the only One we never have to perform for, is a good place to start. For a personal question about a particular sin, a qualified scholar is the right person to ask.
How do we pray salatul tawbah?
Salatul tawbah, the prayer of repentance, is two rak'ahs prayed after making wudu well, followed by asking Allah's pardon. Abu Bakr heard the Prophet ﷺ say:
"When a servant (of Allah) commits a sin, and he performs ablution well, and then stands and prays two rak'ahs, and asks pardon of Allah, Allah pardons him."
He then recited the verse above. The sequence is simple enough to do tonight: wudu, two rak'ahs, then asking. The hadith names no special surah and no special hour, so we shouldn't add any and call them part of it.
On days without prayer, nothing closes. The verse speaks of remembering Allah and seeking forgiveness, and both can be done from the edge of a bed. Some nights we'll cry. Other nights we'll feel very little and go to sleep. Either way, the asking has happened, and the verse and the hadith both describe the asking, with nothing said about how it has to feel.
How do we repent for a sin nobody knows about?
A sin nobody knows about can be repented for directly with Allah, and nothing in these texts asks us to confess to another person. The Prophet ﷺ warned against announcing a sin Allah has covered:
"... a person commits a sin at night and though Allah screens it from the public, then he comes in the morning, and says, 'O so-and-so, I did such-and-such (evil) deed yesterday,' though he spent his night screened by his Lord ..."
He also said, "The servant (whose fault) Allah conceals in this world, Allah would also conceal (his faults) on the Day of Resurrection" (Abu Huraira, Sahih Muslim 2590a.
This covering has limits. It concerns our own private failings, and it gives no cover for hiding harm being done to someone. Asking for help is also different from boasting. An imam or a counsellor can help with a habit that keeps looping, and we can ask for that help without performing the details for anyone.
What does Islam say about a guilty conscience?
A guilty conscience has a description in the Sunnah. Nawwas ibn Sam'an asked the Prophet ﷺ about virtue and vice, and he answered:
"Virtue is a kind disposition and vice is what rankles in your heart and that you disapprove that people should come to know of it."
The hadith gives us a test for recognising wrongdoing, and it stops there. It doesn't say every private thing is a sin. Our health, our grief and what was done to us can stay private with no wrong in them at all.
Ibn Mas'ud, speaking in his own words, said a believer sees his sins as if sitting under a mountain that may fall on him, while a wicked person treats them like flies passing over his nose (Abdullah ibn Mas'ud, Sahih al-Bukhari 6308. So a heart that still jumps is worth listening to. Our piece on the shame spiral after sin picks up what happens when that feeling turns on us.
Do we have to apologise to the person we wronged?
Repentance for a wrong against another person includes seeking their forgiveness. The Prophet ﷺ said:
"Whoever has oppressed another person concerning his reputation or anything else, he should beg him to forgive him before the Day of Resurrection ..."
The word "reputation" is the one that catches us. What we said about a cousin belongs on this list, along with money we owe and never mentioned. Sometimes asking forgiveness is straightforward. Sometimes telling the person would hurt them more, or wouldn't be safe, and a scholar can help us think that through. Returning what we took and speaking well of someone we've damaged are both things we can often start on quietly.
What du'a can we say when asking forgiveness?
The du'a the Prophet ﷺ called the most superior way of asking forgiveness, often known as Sayyid al-Istighfar, reads:
"O Allah, You are my Lord, there is none worthy of worship except You. You have created me, and I am Your servant, and I am faithful to Your covenant and promise as much as I can. I seek refuge in You from the evil of what I have done. I acknowledge Your blessings upon me, and I admit my sins. So forgive me, for none forgives sins except You."
In the narration's transliteration: Allahumma anta Rabbi la ilaha illa anta, Khalaqtani wa ana 'Abduka, wa ana 'ala 'ahdika wa wa'dika mastata'tu, A'udhu bika min Sharri ma sana'tu, abu'u Laka bini'matika 'alaiya, wa abu'u laka bidhanbi faghfir lee fa innahu la yaghfiru adhdhunuba illa anta.
He added that whoever says it with firm faith during the day and dies before evening, or at night and dies before morning, will be from the people of Paradise. Memorising it can come later. The plain sentence in our own language is still a du'a tonight.
What does research say about keeping secrets?
Keeping a secret can weigh on us through how often we think about it, apart from how often we have to hide it. Ten studies found that people's minds wander to their secrets far more often than they have to actively hide them, and that this mind-wandering predicts lower well-being.2 Some of those studies followed people over time. A broad review looked at shame and guilt as moral emotions, including the relative advantages and disadvantages of each.3 It says nothing about repentance.
Neither study tested tawbah. We mention them because the two a.m. wakefulness is familiar, and it's interesting that researchers have found something like it.
Will Allah forgive a sin we keep repeating?
Allah's forgiveness stays open for the person who keeps returning, and the Qur'an speaks to that fear directly:
"Say, "O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allāh. Indeed, Allāh forgives all sins. Indeed, it is He who is the Forgiving, the Merciful.""
The Prophet ﷺ also said Allah would replace a people who never sinned with "those people who would commit sin and seek forgiveness from Allah, and He would have pardoned them" (Abu Huraira, Sahih Muslim 2749. And he said Allah is more pleased with a slave's repentance than a man stranded where his life is in danger, who wakes to find his lost riding beast standing beside him (Abdullah ibn Mas'ud, Sahih al-Bukhari 6308.
So we go back. We resolve again, and we mean it again. Tonight, when the house goes quiet, there's wudu, two rak'ahs and one plain sentence. Who else was ever going to hear it?
Frequently asked questions
How do we repent to Allah for a sin no one knows about?
We stop, regret it, resolve not to return and ask Allah's forgiveness directly. The sin can stay private. The Prophet ﷺ warned against exposing what Allah has screened (Abu Huraira, Sahih al-Bukhari 6069).
How is salatul tawbah prayed?
The hadith describes performing wudu well, praying two rak'ahs and asking Allah's pardon (Abu Bakr, Sunan Abi Dawud 1521). It names no special surah or time.
Can we repent without praying, on days without prayer?
Yes, the du'a is open. Qur'an 3:135 describes remembering Allah and seeking forgiveness, and that doesn't depend on being able to pray that day.
Why do we still feel guilty after repenting?
Feelings can lag behind the asking. We've written about this at length in why we still feel guilty after repenting.
Which sin does Allah not forgive?
Qur'an 4:48 says, "Indeed, Allāh does not forgive association with Him, but He forgives what is less than that for whom He wills." Qur'an 39:53 tells those who have sinned not to despair of His mercy. How the two verses fit together is a question for a qualified scholar.
Keep reading
Sources
Qur'an 3:135, 39:53 and 4:48, Saheeh International
Research and references
The Conditions of Repentance, SeekersGuidance.
Slepian ML, et al. (2017). The experience of secrecy. Journal of Personality and Social Psychology 113(1).
Tangney JP, et al. (2007). Moral emotions and moral behavior. Annual Review of Psychology 58.