Short answer
Anyone may attend, including non-Muslim friends and colleagues. Dress modestly, expect men and women to stand separately, and take off your shoes in a mosque prayer area. Non-Muslims do not join the prayer but may stand quietly at the back. Kind words and help for the family are welcome; flowers are not part of the custom.
Following a Muslim's funeral is a recommended act and a right of the deceased. Non-Muslims may attend to support the family, but the janazah prayer itself is prayed only by Muslims.
The four schools agree on this.
Explanation
Muslim funerals are open to the community, and a friend, neighbour or colleague who comes is a real comfort to the family. You do not need to know the prayers. Here is what to expect.
- Timing. Funerals happen fast, often within a day of the death. The janazah prayer is often held right after one of the daily prayers at the mosque, so arrive a little early.
- Clothes. Modest, loose and plain. Women usually cover their hair in the prayer area; men wear long trousers. See what to wear.
- Shoes. Mosque prayer areas are shoe-free, so wear clean socks.
- Rows. Men and women stand in separate areas. Non-Muslim guests can stand quietly at the back or to the side.
- The burial. In many communities only men go to the graveside. Ask the family or the imam what is expected.
- What to say. A simple "I am so sorry for your loss, may God give you patience" is enough. Muslims say Inna lillahi wa inna ilayhi raji'un.
What to avoid: loud talk, photos of the body or the family, flowers and wreaths, and alcohol at any gathering. If you want to help, bring cooked food to the family in the following days, or give to a charity in the person's name. When Ja'far was killed, the Prophet ﷺ told his Companions to prepare food for his family.
For Muslims attending: stay for the burial if you can, help fill the grave, and make dua for the dead. See the reward of attending a janazah and how to give condolences.
The evidence
Quran, Surah Al-Mumtahana 60:8
لَّا يَنْهَىٰكُمُ ٱللَّهُ عَنِ ٱلَّذِينَ لَمْ يُقَٰتِلُوكُمْ فِى ٱلدِّينِ وَلَمْ يُخْرِجُوكُم مِّن دِيَٰرِكُمْ أَن تَبَرُّوهُمْ وَتُقْسِطُوٓا۟ إِلَيْهِمْ ۚ إِنَّ ٱللَّهَ يُحِبُّ ٱلْمُقْسِطِينَ ﴿٨﴾
Allah does not forbid you from those who do not fight you because of religion and do not expel you from your homes - from being righteous toward them and acting justly toward them. Indeed, Allah loves those who act justly.
Kindness between Muslims and non-Muslims at times of loss is welcome.
Sunan Abi Dawud 3132
Graded hasan... اصنعوا لآل جعفر طعاما فإنه قد أتاهم أمر شغلهم ...
"Prepare food for the family of Ja'far, for something has come to them that keeps them busy."
Bringing food is the sunnah way to support a grieving family.
Sahih al-Bukhari 1240
Sahih... حق المسلم على المسلم خمس رد السلام وعيادة المريض واتباع الجنائز ...
"The rights of a Muslim over a Muslim are five, among them returning the greeting, visiting the sick and following funerals."
Muslims attend funerals as a right owed to the dead.
Where the ruling is recorded
- al-Fatawa al-Hindiyya, Kitab al-Salah, chapter on the jana'iz. The etiquette of carrying and following the funeral.
- Radd al-Muhtar (Ibn Abidin), Kitab al-Salah, Bab Salat al-Janazah. Condolence and food for the bereaved family.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. 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.