Scholars agree

Will Allah forgive what I did before I knew better?

Yes. Repentance wipes out what came before it, and entering Islam wipes out everything before that — no exceptions carved out for particular sins. What repentance asks of you is that you stop, regret it, and intend not to return; where you wronged a person rather than only yourself, it also asks that you put that right if you can.

The four schools concur on this.

The long answer

This is the question people are most afraid to ask, so it is worth answering directly: yes, and the Qur’an says so in unusually unqualified terms.

“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."” (Qur’an 39:53)

Notice what that verse does not do. It does not list which sins qualify, and it does not grade them. It addresses the people who have gone furthest and tells them specifically not to despair.

Repentance (tawba) has three parts, and none of them is a ceremony:

1. Stop doing it. 2. Regret having done it. 3. Resolve not to go back.

There is a fourth where the sin involved another person — money taken, a reputation damaged, someone harmed. Then returning what is owed, or seeking their pardon, is part of it, because the wrong is theirs to forgive and not only Allah’s.

Two things commonly get in the way. The first is the belief that you must feel clean before you can pray; in fact prayer is where the repair happens, not a reward for having already completed it. The second is repeated failure — falling back into the same sin and concluding that repentance has stopped counting. It has not. Repenting again after relapsing is itself an act of faith, and the tradition treats despair as the more dangerous state of the two.

The Qur’an goes further than pardon in one striking passage, describing bad deeds being exchanged for good ones: “Except for those who repent, believe and do righteous work. For them Allah will replace their evil deeds with good. And ever is Allah Forgiving and Merciful.” (Qur’an 25:70)

And for someone entering Islam, the slate is not merely wiped — nothing before it is carried forward at all.

What it rests on