Short answer
As soon as reasonably possible. Hastening the washing, prayer and burial is sunnah, and delaying without a good reason is disliked. There is no fixed 24 hour rule in fiqh, but many families manage burial within a day. Delays for legal paperwork, a required inquiry or confirming death are excused.
Hastening the preparation and burial is sunnah once death is certain. Delaying it without need, for example to gather a bigger crowd for the prayer, is makruh. Waiting for a close relative who is near and will arrive soon is tolerated if it is short.
The four schools agree on this.
Explanation
The four schools agree that the body should be prepared and buried quickly. The Prophet ﷺ said to hurry with the funeral: if the person was good, you are taking them to something better, and if not, you are putting a burden off your shoulders.
Is there a 24 hour rule? No fixed hour is set in the Quran or sunnah. "Within 24 hours" is a common goal that comes from the sunnah of hastening, not a condition. If burial happens on the second or third day because of a real reason, nothing is wrong with the burial and nobody is sinful.
Valid reasons for delay:
- Making sure the person has really died.
- A death certificate, coroner or medical examiner process that the law requires.
- Weekend or holiday closures of the registry or cemetery.
- A short wait for a close relative who is about to arrive.
Disliked reasons for delay: waiting days for relatives abroad, holding the body so more people attend, or waiting for a Friday crowd. A smaller janazah on time is better than a large one after needless delay. Relatives who cannot arrive can make dua and visit the grave later.
Practical help: tell the hospital or hospice early that the family is Muslim and needs a quick release, and call your local mosque or Muslim funeral service at once. In the UK and many US cities, coroners and registrars have out of hours processes for faith burials. See sending a body home if that is being discussed.
The evidence
Sahih al-Bukhari 1315
Sahih... أسرعوا بالجنازة فإن تك صالحة فخير تقدمونها إليه ...
"Hurry with the funeral. If the person was righteous, it is good you are sending them to."
This is the main evidence for hastening burial.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Salah, Bab Salat al-Janazah. Hastening the preparation and the dislike of delay for a larger congregation.
- al-Fatawa al-Hindiyya, Kitab al-Salah, chapter on jana'iz. The dislike of delaying the janazah to wait for the Friday crowd.
This answer is pending review by the scholars on our team. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.