Are You Allowed to Pray in the Bathroom?
Question

I reverted to Islam a few years ago alhamdulillah. My parents despise it. They will not let me pray and they cause me much grief. They make me cry a lot when they attack me verbally. I try to uphold my family ties. When it is time to pray I try to leave the room and they will not allow it. So sometimes I have had to resort to praying in the bathroom because I fear I will miss it if I don’t. I’m aware it is haram but it is the only place they cannot see me doing it. If they catch me praying anywhere else I fear they will hurt me or attack me mentally. What can I do?
Praise be to Allah.The Importance of Prayer in Islam
We ask Allah to increase you in faith and piety, and to grant you the joy of seeing your parents and relatives being guided to Islam.
Prayer is the most important pillar of Islam after the twin declaration of faith, and it is not permissible to omit it or be careless concerning it no matter what the reasons. Rather the individual should offer the prayer according to his ability, standing or sitting or lying down. He may even offer the prayer by means of gestures whilst walking if he is fleeing from a wild animal or flood. So long as he is of sound mind, the prayer is not waived for him. If it is difficult for him to pray at any time, it is permissible for him to put Dhuhr and `Asr together, and to put Maghrib and `Isha’ together. This is by the grace and mercy of Allah.
Praying in Difficult Circumstances: Combining Prayers for Ease
Based on that, if your family’s seeing you pray will result in obvious trouble for you, such as being beaten or thrown out or shunned, then it is permissible for you to put Dhuhr and `Asr together, and to put Maghrib and `Isha’ together, at the time of the earlier or later prayer, according to whatever is easiest for you, because putting prayers together is permissible for many reasons, including travel, sickness, rain, fear for oneself or one’s property, and to relieve one of hardship and difficulty.
Why is Praying in Bathrooms Prohibited in Islam
As for praying in the bathroom, that is not allowed, whether it is a place that is only for bathing or it is a place for relieving oneself, because it is the abode of the devils and the place where `Awrahs are uncovered.
At-Tirmidhi (317), Abu Dawud (492) and Ibn Majah narrated from Abu Sa`id Al-Khudri (may Allah be pleased with him) that he said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “All the earth is a place of prayer except graveyards and bathrooms.” The Hadith was classed as authentic by Ibn Hibban and Al-Albani in Sahih Sunan At-Tirmidhi.
Praying in Exceptional and Extreme Situations
This Hadith indicates that prayers offered in the bathroom are not valid, hence it is not permissible to do that except in the case of necessity, such as if the harm that will befall you from your parents is extreme and you cannot pray anywhere else, even by putting prayers together as mentioned above. In that case, it is permitted for you to pray in the bathroom.
Shaykh Ibn Baz (may Allah have mercy on him) was asked about a Christian boy who became Muslim secretly and feared trouble for the sake of his religion if his family found out that he had become Muslim, and he is a young student in school. He does not have a place to pray and he is afraid that if they find out about him, they may send him to a non-Muslim country or try to make him give up his religion, and he is a person who cannot be steadfast because he is still young. Is it permissible for him to pray in the bathroom?
He replied:
It seems that there is nothing wrong with it if he cannot find any other place. If he prays in front of them they may find out about him and try to make him give up his religion. If he cannot find any other place then there is nothing wrong with it, but he may find another place, or he may find a place for some of the prayers and not for others. Hence if he can find another place then he has to pray there, because praying in the bathroom is not allowed, as it is forbidden to pray in graveyards and bathrooms. But if he cannot find any other place, he should not omit the prayer. (End quote)
See also the lecture: Mashakil wal-Hulul by Shaykh Munajjid.
And Allah knows best.