Short answer
Praying inside the Kaaba is allowed and rewarding, as the Prophet ﷺ prayed there, but the door is opened only on rare occasions and ordinary pilgrims cannot go in. You can pray in the Hijr (the semicircle beside it), which is part of the House. In the Hanafi school both fard and voluntary prayers inside are valid.
Prayer inside the Kaaba is valid, fard and nafl alike, facing any of its walls, since whichever way you face you are facing part of it. Praying on its roof is valid but makruh, as it is disrespectful to stand above the House.
Other madhhabs
- Maliki
- A voluntary prayer inside is allowed, but a fard prayer should not be prayed there; if it is, it is repeated within its time.
- Hanbali
- Voluntary prayers inside are valid; a fard prayer inside the Kaaba or on its roof is not valid in the relied-upon view.
Explanation
Ibn Umar reported that the Prophet ﷺ entered the Kaaba on the day Makkah was conquered with Usamah, Bilal and Uthman ibn Talhah, and Bilal told him that he prayed inside between the pillars. So entering it and praying there is a Sunnah act, not a forbidden one.
In practice: the Kaaba is kept locked. Its door is opened for the washing of its inner walls and for invited guests, so a normal pilgrim on Hajj or umrah will not go inside. Do not push or crowd at the door hoping to get in, since harming people near the House is a sin.
The Hijr: when A'ishah (may Allah be pleased with her) wanted to pray inside, the Prophet ﷺ took her into the Hijr and told her that it is part of the House, which the Quraysh left out when they rebuilt it with limited funds. So praying in the Hijr is the open way to pray in the Kaaba today. Go when it is less crowded, often late at night. See what is Hijr Ismail.
The Shafi'i school agrees with the Hanafis that fard and voluntary prayers inside are valid. For what the inside looks like and its history, see our Kaaba facts.
The evidence
Quran, Surah Al-Baqara 2:125
وَإِذْ جَعَلْنَا ٱلْبَيْتَ مَثَابَةًۭ لِّلنَّاسِ وَأَمْنًۭا وَٱتَّخِذُوا۟ مِن مَّقَامِ إِبْرَٰهِۦمَ مُصَلًّۭى ۖ وَعَهِدْنَآ إِلَىٰٓ إِبْرَٰهِۦمَ وَإِسْمَٰعِيلَ أَن طَهِّرَا بَيْتِىَ لِلطَّآئِفِينَ وَٱلْعَٰكِفِينَ وَٱلرُّكَّعِ ٱلسُّجُودِ ﴿١٢٥﴾
And [mention] when We made the House a place of return for the people and [a place of] security. And take, [O believers], from the standing place of Abraham a place of prayer. And We charged Abraham and Ishmael, [saying], "Purify My House for those who perform Tawaf and those who are staying [there] for worship and those who bow and prostrate [in prayer]."
The House is a place of tawaf, prayer, bowing and prostration.
Sahih al-Bukhari 1598
Sahih... دخل رسول الله صلى الله عليه وسلم البيت هو وأسامة بن زيد وبلال ...
"The Messenger of Allah entered the House with Usamah ibn Zayd and Bilal, and Bilal said he prayed inside it between the two Yemeni pillars."
The Prophet ﷺ prayed inside the Kaaba.
Jami' at-Tirmidhi 876
Grading to be checked... صلي في الحجر إن أردت دخول البيت فإنما هو قطعة من البيت ...
"Pray in the Hijr if you want to enter the House, for it is a part of the House."
Praying in the Hijr counts as praying inside the Kaaba.
Where the ruling is recorded
- al-Hidaya, Kitab al-Salah, chapter on prayer inside the Kaaba. Fard and nafl prayers inside the Kaaba are valid; praying on its roof is disliked.
- Radd al-Muhtar (Ibn Abidin), Kitab al-Salah, chapter on prayer in the Kaaba. Details facing any wall and congregations inside.
- al-Mughni (Ibn Qudama), Kitab al-Salah, on prayer in the Kaaba. The Hanbali view that only voluntary prayer is valid inside.
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.