Islam's answer to why God allows suffering has three parts. This life is a test, not a final reward, so hardship is part of its design. This world is not the final scale of justice, because every wrong is settled in the hereafter. And God's wisdom often works in ways we cannot see at the time, as the Quran's story of Moses and al-Khidr shows.
That answer does not make pain less real. The Prophet Muhammad (peace be upon him) wept when his infant son died. If you are reading this while grieving or struggling, the Islamic tradition does not ask you to pretend you are fine. This guide takes the question seriously, first as philosophers frame it and then as the Quran and hadith respond, and ends with what Muslims are taught to do when suffering comes.
Key takeaways
- The Quran says God "created death and life to test you [as to] which of you is best in deed" (Quran 67:2), framing hardship as part of life's purpose.
- The Prophet said that no fatigue, illness, sorrow or harm befalls a Muslim, "even if it were the prick he receives from a thorn," without God expiating sins through it (Sahih al-Bukhari 5641).
- The story of Moses and al-Khidr (Quran 18:60–82) shows events that look harmful turning out to be mercy once their hidden purpose is known.
- J. L. Mackie's "Evil and Omnipotence" (Mind, 1955) argued that evil is logically incompatible with an all-powerful, all-good God; William Rowe's 1979 paper recast it as an argument from probability.
- The Prophet said that on the Day of Resurrection rights will be restored "even the hornless sheep will lay claim upon the horned one" (Sahih Muslim 2582), so no injustice goes unaddressed.
The honest question
If God is all-powerful, He could stop suffering. If He is all-good, He would want to. Yet children die of cancer, earthquakes bury cities and people commit atrocities. Why?
Philosophers call this the problem of evil, and it comes in two forms. The logical problem, set out by J. L. Mackie in "Evil and Omnipotence" (Mind, 1955), claims that God's power, God's goodness and the existence of evil cannot all be true together. The evidential problem, made famous by William Rowe in "The Problem of Evil and Some Varieties of Atheism" (American Philosophical Quarterly, 1979), is more modest. Rowe asks us to picture a fawn burned in a forest fire, suffering for days before dying, with no one to learn from it. Such pointless-seeming suffering, he argued, makes God's existence unlikely.
Islam's answer starts with what kind of world this is meant to be.
Life is a test, not a reward
The Quran is direct about the purpose of life:
[He] who created death and life to test you [as to] which of you is best in deed - and He is the Exalted in Might, the Forgiving -
If this world were designed to be a paradise, suffering would be evidence against God. But the Quran never says it is. It says the world is a place of trial, where patience, courage, generosity and faith can only exist because hardship does. You cannot be brave without danger or generous without need.
The Quran even names the tests in advance:
And We will surely test you with something of fear and hunger and a loss of wealth and lives and fruits, but give good tidings to the patient,
Ease is a test too: "We test you with evil and with good as trial" (Quran 21:35). Wealth tests gratitude in the way poverty tests patience. Our guide to Surah al-Mulk explores the chapter that opens with this verse.
The Christian philosopher John Hick made a parallel argument in Evil and the God of Love (1966), describing the world as a place of "soul-making."
This world is not the final scale
Much of the problem of evil assumes that this life is all there is. If it were, a child's death would be the end of that child's story. In Islam, it is not.
The Quran repeatedly links suffering to a later, perfect justice. Every soul will be repaid in full, and the Prophet said that on the Day of Resurrection rights will be restored so completely that "even the hornless sheep will lay claim upon the horned one" (Sahih Muslim 2582). Scholars have cited this hadith on the question of animal suffering, Rowe's fawn included: even creatures with no moral responsibility will be made whole.
This does not explain each instance of pain, but it changes the arithmetic: finite suffering set against eternal justice and mercy is a different equation from suffering that ends in nothing. What happens after death is covered in our guide to what happens when you die in Islam.
Suffering as purification
The Prophet taught that hardship is never wasted for a believer:
"No fatigue, nor disease, nor sorrow, nor sadness, nor hurt, nor distress befalls a Muslim, even if it were the prick he receives from a thorn, but that Allah expiates some of his sins for that."
— Sahih al-Bukhari 5641
He also said, "If Allah wants to do good to somebody, He afflicts him with trials" (Sahih al-Bukhari 5645). Asked who is tested most severely, he answered, "The Prophets, then those nearest to them," adding that a person is tried according to the strength of their faith (Jami' at-Tirmidhi 2398, graded hasan).
Suffering, in other words, is not a sign that God has abandoned you. The best people who ever lived suffered most.
Free will and moral evil
A large share of the world's suffering is caused by people: war, abuse, fraud, neglect. The Quran places responsibility where it belongs:
Corruption has appeared throughout the land and sea by [reason of] what the hands of people have earned so He may let them taste part of [the consequence of] what they have done that perhaps they will return [to righteousness].
Alvin Plantinga's "free will defense," developed in God, Freedom, and Evil (1974), argues that a world with genuinely free creatures who can choose good is worth more than a world of puppets, even though freedom makes evil possible. The Quran's account of human creation fits this. When God announced He would place humans on earth, the angels asked whether He would place there "one who causes corruption therein and sheds blood." God answered, "Indeed, I know that which you do not know" (Quran 2:30).
Mackie's reply was that an all-powerful God could have made people who always freely choose good. Critics of Mackie answer that freedom which can only go one way is not freedom at all. This is one of the most debated exchanges in modern philosophy of religion.
Hidden wisdom: Moses and al-Khidr
The most vivid Quranic answer to unexplained suffering is a story in Surah al-Kahf. Moses travels with a servant of God, known in tradition as al-Khidr, who has been given special knowledge. Moses watches him do three things that look wrong: he damages a poor family's boat, kills a boy and rebuilds a wall for a town that refused them hospitality.
Moses protests each time. Then al-Khidr explains. The boat was damaged so a tyrant king would not seize it. The boy would have grown up to bring his believing parents to ruin. And the wall hid treasure belonging to two orphans:
And as for the wall, it belonged to two orphan boys in the city, and there was beneath it a treasure for them, and their father had been righteous. So your Lord intended that they reach maturity and extract their treasure, as a mercy from your Lord. And I did it not of my own accord. That is the interpretation of that about which you could not have patience."
Moses was a prophet, and still he could not see the purpose. The story does not say every hardship will be explained to us in this life. It says that our inability to see a reason is not evidence that there is none. Philosophers call a similar position "sceptical theism": given how limited human knowledge is, we should not expect to see God's reasons. Our guide to the benefits of Surah al-Kahf covers the full surah.
The Quran puts it plainly: "perhaps you hate a thing and it is good for you; and perhaps you love a thing and it is bad for you. And Allah Knows, while you know not" (Quran 2:216).
What is qadr? Predestination in Islam explained
Qadr (qadar, قدر), or divine decree, is the sixth article of Islamic faith: the belief that nothing happens outside God's knowledge and will. The Quran says no disaster strikes "except that it is in a register before We bring it into being," and gives the reason it tells us this: "In order that you not despair over what has eluded you and not exult [in pride] over what He has given you" (Quran 57:22–23).
Qadr is meant to steady the heart, not to cancel human choice. Mainstream Sunni theology holds both that God decrees all things and that humans are accountable for their choices; the precise relationship is a question scholars have debated since the earliest centuries, and the Quran asks believers to affirm both. In a hadith in Jami' at-Tirmidhi 2516, graded hasan, the Prophet told the young Ibn Abbas that if the whole of creation gathered to harm him, it could only harm him with what God had already written.
Al-Ghazali went further, reportedly stating that "there is not in possibility anything more wonderful than what is." The statement sparked a debate lasting centuries, studied by Eric Ormsby in Theodicy in Islamic Thought (Princeton University Press, 1984).
| Response | Core idea | Islamic source | Philosophical parallel |
|---|---|---|---|
| Life as a test | Virtue requires real hardship | Quran 67:2, 2:155 | Hick's soul-making (1966) |
| Final justice | Wrongs are settled in the hereafter | Sahih Muslim 2582 | Eschatological theodicy |
| Purification | Hardship erases sins and raises rank | Sahih al-Bukhari 5641 | No close parallel |
| Free will | Humans cause much evil by choice | Quran 30:41, 2:30 | Plantinga's free will defense (1974) |
| Hidden wisdom | We cannot see God's reasons | Quran 18:60–82, 2:216 | Sceptical theism |
| Divine decree | Nothing escapes God's knowledge | Quran 57:22–23 | Al-Ghazali's "best possible world" |
What should you do when you are suffering?
Islam's response to suffering is practical as well as theological.
- Grieve honestly. At the death of his son Ibrahim, the Prophet wept and said, "The eyes are shedding tears and the heart is grieved, and we will not say except what pleases our Lord" (Sahih al-Bukhari 1303). Tears are not a failure of faith.
- Say the words of return. The Quran praises those who, "when disaster strikes them, say, 'Indeed we belong to Allah, and indeed to Him we will return'" (Quran 2:156).
- Practice sabr. Patience in Islam means steadiness, not silence. The Prophet said the believer's affair is all good: gratitude in ease, patience in hardship (Sahih Muslim 2999). See our guide to sabr, patience in Islam.
- Turn to dua. Bring the pain to God directly. Our guide to dua for anxiety and stress collects Quranic and prophetic prayers for hard times.
- Seek help. Medical care, counseling and community support are all part of taking the means God has provided.
The Quran also promises relief: "For indeed, with hardship [will be] ease. Indeed, with hardship [will be] ease" (Quran 94:5–6).
The Names of God behind the answer
Two divine names sit at the heart of Islam's response. Al-Hakim, the Perfectly Wise, means God does nothing without purpose, even when the purpose is hidden. Al-Latif, the Subtle One, describes a kindness that works quietly through events. After years of slavery, prison and separation, Yusuf said: "Indeed, my Lord is Subtle in what He wills" (Quran 12:100).
Read these verses on Quran Universe
You can read the story of Moses and al-Khidr in Surah al-Kahf and the verses on patience in Surah al-Baqarah on Quran Universe, with Arabic text, word-by-word meaning and Tafsir Ibn Kathir. For the wider question of God's existence, see Does God Exist?.
Frequently asked questions
What is the problem of evil in Islam?
The problem of evil asks how an all-powerful, all-good God can allow suffering. Islam responds that life is a test (Quran 67:2), that complete justice comes in the hereafter, that much evil results from human free will (Quran 30:41), and that God's wisdom often exceeds what humans can see, as the story of Moses and al-Khidr in Surah al-Kahf shows.
Why do bad things happen to good people?
Islam teaches that hardship is not a sign of God's displeasure. The Prophet said the people tested most severely are the prophets, then those nearest to them (Jami' at-Tirmidhi 2398). Suffering purifies sins, even a thorn's prick (Sahih al-Bukhari 5641), and patience in hardship is rewarded. Good people suffer because the test is real, not because they are forgotten.
What is qadr in Islam?
Qadr is divine decree, the belief that everything happens within God's knowledge and will. It is the sixth article of Islamic faith. The Quran says disasters are recorded before they occur so that people "not despair over what has eluded you" (Quran 57:22–23). Mainstream Sunni theology affirms both God's decree and human accountability for choices.
Does predestination in Islam mean we have no free will?
No. Mainstream Islamic theology holds that God knows and decrees all things and that humans genuinely choose and are accountable for their choices. The Quran affirms both, and scholars have debated how they fit together since the earliest centuries. In practice, Muslims are taught to make choices, take means and work hard, then accept outcomes with trust in God.
Why does God allow innocent children and animals to suffer?
Islam does not claim to explain every case. It teaches that no suffering is wasted or forgotten: the Prophet said rights will be restored on the Day of Resurrection, "even the hornless sheep will lay claim upon the horned one" (Sahih Muslim 2582). Many scholars hold that children who die young are in Paradise. The story of al-Khidr warns against assuming there is no purpose.
How should a Muslim respond to suffering?
Grieve honestly, as the Prophet did at his son's death (Sahih al-Bukhari 1303). Say "Indeed we belong to Allah, and indeed to Him we will return" (Quran 2:156). Practice patience, turn to God in dua, and seek medical and community support. The Quran promises that "with hardship [will be] ease" (Quran 94:5–6).