Hell is the place of punishment for those who die rejecting God and doing serious wrong, such as oppression and denying truth after it is clear to them. It is a severe warning in the Quran, and Muslims also believe that God's mercy is wide and that He forgives whom He wills.
The fuller answer
The Quran describes Hell with fire and pain as a warning to move people toward goodness. It says that God does not wrong anyone, and each person is judged by what they knew and did. Many scholars hold that a Muslim who has sinned but kept the faith may be punished and then taken out, or be forgiven outright, and that the sin of associating partners with God without repentance is not forgiven.
Muslims believe that no human can know who is in Hell. The Prophet ﷺ taught that God is more merciful than a mother to her child, and that a man was forgiven for giving water to a thirsty dog. Muslims are told never to be sure of anyone's fate.
Indeed, Allah does not forgive association with Him, but He forgives what is less than that for whom He wills. And he who associates others with Allah has certainly fabricated a tremendous sin.
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 say, "The truth is from your Lord, so whoever wills - let him believe; and whoever wills - let him disbelieve." Indeed, We have prepared for the wrongdoers a fire whose walls will surround them. And if they call for relief, they will be relieved with water like murky oil, which scalds [their] faces. Wretched is the drink, and evil is the resting place.
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.