God in Islam is the Most Merciful. Every chapter of the Quran but one opens with His mercy, and the Prophet ﷺ taught that God wrote on Himself: 'My mercy overcomes My anger.'
The fuller answer
The Quran tells those who have sinned and wronged themselves not to despair of God's mercy, for He forgives all sins to the one who repents. A Muslim does not confess to a priest. They turn to God directly at any hour and ask Him to forgive them.
God is also Just, and Islam teaches accountability for wrongs, especially for harming others. But the Prophet ﷺ taught that God is more merciful to His servants than a mother is to her child. The Muslim's relationship with God is one of love, hope and awe together.
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."
And decree for us in this world [that which is] good and [also] in the Hereafter; indeed, we have turned back to You." [Allah] said, "My punishment - I afflict with it whom I will, but My mercy encompasses all things." So I will decree it [especially] for those who fear Me and give zakah and those who believe in Our verses -
Say, "To whom belongs whatever is in the heavens and earth?" Say, "To Allah." He has decreed upon Himself mercy. He will surely assemble you for the Day of Resurrection, about which there is no doubt. Those who will lose themselves [that Day] do not believe.
This answer follows the mainstream Sunni understanding and is general learning, not a fatwa. Where Muslims differ, the answer says so. Have a question of your own? Write to us.