Short answer
Going out alone in her own town for work, study, shopping, the mosque or visiting family is allowed with hijab and where it is safe. Long journeys need a mahram. Living alone is allowed for a mature woman who is safe and trusted, though classical Hanafi law gives a father a say over a young unmarried daughter.
Leaving the house for needs within the town is permitted. Travel of about 48 miles (77 km) or more needs a husband or mahram. After puberty a father may keep a young unmarried daughter in his household; an older woman of sound judgment, or a previously married woman who is trustworthy, may live on her own where it is safe. A married woman lives where her husband provides and goes out with his consent except for necessities.
The four schools agree on this.
Explanation
Women went out in the Prophet's time for their needs. When Umar objected to the women of the household being seen outside, the Prophet ﷺ said Allah has permitted you to go out for your needs. At the same time, the Quran tells the Prophet's wives to stay in their homes and not to display themselves as in the days of ignorance, which scholars take as a call for the home to be a woman's base, not a prison.
Going out alone, in practice:
- Allowed: work, college, groceries, appointments, the mosque, visiting family and friends, driving yourself.
- Conditions: proper hijab, no perfume that men can smell, avoiding unsafe places and late hours where there is real risk.
- Travel: a trip of about 48 miles or more needs a mahram in the Hanafi school. See travelling without a mahram.
- Married women: see the rights of a husband on going out with his knowledge.
Living alone: the Hanafi books discuss this under custody of adult daughters. A father may keep his young unmarried daughter with him after puberty, even when there is no particular danger. An older woman of sound judgment, or a divorcee or widow who is trustworthy, may live alone. Today this often means a student or worker in another city. Scholars advise choosing a safe building, keeping in close contact with family, and never having a non-mahram man stay over, since the Prophet ﷺ forbade a man to spend the night at the home of a previously married woman unless he is her husband or mahram, and the scholars say this applies even more to an unmarried one.
The evidence
Quran, Surah Al-Ahzaab 33:33
وَقَرْنَ فِى بُيُوتِكُنَّ وَلَا تَبَرَّجْنَ تَبَرُّجَ ٱلْجَٰهِلِيَّةِ ٱلْأُولَىٰ ۖ وَأَقِمْنَ ٱلصَّلَوٰةَ وَءَاتِينَ ٱلزَّكَوٰةَ وَأَطِعْنَ ٱللَّهَ وَرَسُولَهُۥٓ ۚ إِنَّمَا يُرِيدُ ٱللَّهُ لِيُذْهِبَ عَنكُمُ ٱلرِّجْسَ أَهْلَ ٱلْبَيْتِ وَيُطَهِّرَكُمْ تَطْهِيرًۭا ﴿٣٣﴾
And abide in your houses and do not display yourselves as [was] the display of the former times of ignorance. And establish prayer and give zakah and obey Allah and His Messenger. Allah intends only to remove from you the impurity [of sin], O people of the [Prophet's] household, and to purify you with [extensive] purification.
The home is a woman's base, and going out is with modesty.
Sahih al-Bukhari 5237
Sahih... قد أذن الله لكن أن تخرجن لحوائجكن ...
"Allah has permitted you to go out for your needs."
Women may go out for their needs.
Sahih al-Bukhari 1086
Sahih... لا تسافر المرأة ثلاثة أيام إلا مع ذي محرم ...
"A woman should not travel for three days except with a mahram."
The Hanafi school takes this three-day journey, about 48 miles, as the distance that needs a mahram.
Sahih Muslim 2171
Sahih... ألا لا يبيتن رجل عند امرأة ثيب إلا أن يكون ناكحا أو ذا محرم ...
"Let no man spend the night at the home of a previously married woman unless he is her husband or a mahram."
A woman living alone does not host a non-mahram man overnight.
Where the ruling is recorded
- al-Hidaya, Kitab al-Talaq, chapter on custody (Bab al-Hadana). After puberty a father keeps a virgin daughter with him unless she is older and of sound judgment; a previously married woman who is trustworthy may live on her own.
- Radd al-Muhtar (Ibn Abidin), Kitab al-Hajj, the conditions for a woman's travel. A woman may not travel the distance of a journey without her husband or a mahram.
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.