Questions Prayer

Can Muslims pray anywhere?

Checked by our team

Short answer

Yes, almost anywhere that is clean, because the Prophet ﷺ said the whole earth was made a place of prayer. Men are encouraged to pray the fard in congregation at a mosque. In the Hanafi school a few places are disliked, such as a bathroom, a graveyard facing the graves, and the middle of a path.

Hanafi position

Any pure (tahir) place is valid for prayer. Praying in a toilet or bathhouse, on a path where people walk, facing a grave without a barrier, in a camel pen, or facing a picture is makruh, but the prayer counts. Men should pray the fard prayers with the congregation in the masjid where they can.

Other madhhabs
Hanbali
Prayer in a graveyard, a bathroom, a toilet or a camel pen is not valid at all, not merely disliked.
Shafi'i
Valid but disliked in these places, like the Hanafi view; ground known to be impure must be covered.
Maliki
Prayer in a clean graveyard is allowed without dislike; praying in a camel pen or a church is disliked.

Explanation

Muslims usually pray at a masjid (mosque), but a mosque is not required. The Prophet ﷺ said the whole earth was made a place of prayer for his community, so wherever the time comes, you pray: at home, at work, in a park, at an airport or at a rest stop.

What matters are the conditions of prayer: a clean body and clothes, a clean spot to stand and prostrate, your awrah covered, facing the qibla, and the time having begun. If you are unsure whether the ground is clean, put down a jacket, a mat or a clean cloth. See the conditions of salah.

Places where prayer is disliked in the Hanafi school:

  • A toilet or a bathroom
  • A graveyard, when a grave is in front of you with no barrier
  • The middle of a path or road where you block people
  • Facing a picture of a living being at eye level or ahead of you
  • Someone else's land or home against their wishes

For men, praying the five prayers in the masjid with the congregation carries far more reward and is close to obligatory; see is praying in congregation obligatory. For other places people ask about, read praying in a church and do you need a prayer mat.

The evidence

Sahih al-Bukhari 335

Sahih

... وجعلت لي الأرض مسجدا وطهورا فأيما رجل من أمتي أدركته الصلاة فليصل ...

"The earth has been made for me a place of prayer and a means of purification, so whoever of my community is caught by the prayer time, let him pray."

Prayer is valid anywhere clean.

Sahih al-Bukhari 335 · Sahih · Read on sunnah.com

Sahih Muslim 972

Sahih

... لا تجلسوا على القبور ولا تصلوا إليها ...

"Do not sit on graves and do not pray towards them."

Praying facing graves is forbidden.

Sahih Muslim 972 · Sahih · Read on sunnah.com

Jami' at-Tirmidhi 317

Grading to be checked

... الأرض كلها مسجد إلا المقبرة والحمام ...

"The whole earth is a place of prayer except the graveyard and the bathhouse."

Graveyards and bathhouses are exceptions.

Jami' at-Tirmidhi 317 · Grading to be checked · Read on sunnah.com

Where the ruling is recorded

  • Nur al-Idah with Maraqi al-Falah, Kitab al-Salah, chapter on what is disliked in prayer. Lists the places where prayer is disliked, such as a bathhouse, a graveyard and a road.
  • al-Fatawa al-Hindiyya, Kitab al-Salah, chapter on what is disliked in prayer. Prayer in these places is valid with dislike.
  • al-Mughni (Ibn Qudama), Chapter on places where prayer is not allowed. The Hanbali school holds prayer invalid in a graveyard, bathroom and camel pen.

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.