Sahih Muslim 3267
The Book of Pilgrimage
حَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ، عَنِ ابْنِ أَبِي ذِئْبٍ، حَدَّثَنَا سَعِيدُ، بْنُ أَبِي سَعِيدٍ عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " لاَ يَحِلُّ لاِمْرَأَةٍ تُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ تُسَافِرُ مَسِيرَةَ يَوْمٍ إِلاَّ مَعَ ذِي مَحْرَمٍ " .
Abu Huraira (Allah be pleased with him) reported Allah's Apostle (ﷺ) as saying:It is not lawful for a woman who believes in Allah and the Hereafter to undertake a day's journey except in the company of a Mahram
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.