Short answer
Enter the masjid before sunset on the 20th day of Ramadan, so you are there when the 21st night begins, with the intention of the sunnah itikaf of the last ten days. It ends at sunset on the last day, when the Eid moon is confirmed, after 29 or 30 fasts. The four schools agree on this start in their main view.
The sunnah mu'akkadah kifayah itikaf of the last ten days begins just before sunset on the 20th of Ramadan and ends with the sighting of the Shawwal moon. Entering after sunset means the full sunnah itikaf has been missed, and it becomes a nafl itikaf.
Other madhhabs
- Maliki
- It is recommended to stay in the masjid on the night of Eid and leave only to go to the Eid prayer.
Explanation
The Prophet ﷺ kept the last ten days of Ramadan in itikaf every year until he passed away, and told those who had joined him to keep the last ten. Because the Hijri day starts at sunset, the last ten begin with the 21st night, which starts at sunset on the 20th day.
Timeline:
- Day 20, before Maghrib: enter the masjid with the intention of the sunnah itikaf of the last ten days. Many people arrive after Asr.
- The ten days: stay in the masjid, leaving only for the needs allowed. See leaving the masjid.
- The end: itikaf ends at Maghrib on the 29th if the Eid moon is confirmed, otherwise at Maghrib on the 30th.
The report about Fajr. Aisha reported that when the Prophet ﷺ wanted to begin itikaf he prayed Fajr and then entered his place of itikaf. Most scholars explain that he was already in the masjid from the night and that this was the time he entered the small tent set up for him. A few scholars took it to mean starting after Fajr on the 21st, but the four schools in their main view start before the 21st night so that it is included, as it may be Laylatul Qadr.
- If you arrive after sunset on the 20th, you can still stay as a nafl itikaf, but it is not the full sunnah.
- Women in the Hanafi school observe itikaf in their prayer place at home.
- Pack light and plan suhoor and iftar in advance.
See the itikaf guide, itikaf for less than 10 days and what breaks itikaf.
The evidence
Quran, Surah Al-Baqara 2:187
أُحِلَّ لَكُمْ لَيْلَةَ ٱلصِّيَامِ ٱلرَّفَثُ إِلَىٰ نِسَآئِكُمْ ۚ هُنَّ لِبَاسٌۭ لَّكُمْ وَأَنتُمْ لِبَاسٌۭ لَّهُنَّ ۗ عَلِمَ ٱللَّهُ أَنَّكُمْ كُنتُمْ تَخْتَانُونَ أَنفُسَكُمْ فَتَابَ عَلَيْكُمْ وَعَفَا عَنكُمْ ۖ فَٱلْـَٰٔنَ بَٰشِرُوهُنَّ وَٱبْتَغُوا۟ مَا كَتَبَ ٱللَّهُ لَكُمْ ۚ وَكُلُوا۟ وَٱشْرَبُوا۟ حَتَّىٰ يَتَبَيَّنَ لَكُمُ ٱلْخَيْطُ ٱلْأَبْيَضُ مِنَ ٱلْخَيْطِ ٱلْأَسْوَدِ مِنَ ٱلْفَجْرِ ۖ ثُمَّ أَتِمُّوا۟ ٱلصِّيَامَ إِلَى ٱلَّيْلِ ۚ وَلَا تُبَٰشِرُوهُنَّ وَأَنتُمْ عَٰكِفُونَ فِى ٱلْمَسَٰجِدِ ۗ تِلْكَ حُدُودُ ٱللَّهِ فَلَا تَقْرَبُوهَا ۗ كَذَٰلِكَ يُبَيِّنُ ٱللَّهُ ءَايَٰتِهِۦ لِلنَّاسِ لَعَلَّهُمْ يَتَّقُونَ ﴿١٨٧﴾
It has been made permissible for you the night preceding fasting to go to your wives [for sexual relations]. They are clothing for you and you are clothing for them. Allah knows that you used to deceive yourselves, so He accepted your repentance and forgave you. So now, have relations with them and seek that which Allah has decreed for you. And eat and drink until the white thread of dawn becomes distinct to you from the black thread [of night]. Then complete the fast until the sunset. And do not have relations with them as long as you are staying for worship in the mosques. These are the limits [set by] Allah, so do not approach them. Thus does Allah make clear His ordinances to the people that they may become righteous.
Itikaf is staying in the masjid for worship.
Sahih al-Bukhari 2026
Sahih... كان يعتكف العشر الأواخر من رمضان حتى توفاه الله ...
"He used to observe itikaf in the last ten days of Ramadan until Allah took him."
The sunnah itikaf is the last ten days.
Sahih al-Bukhari 2027
Sahih... من كان اعتكف معي فليعتكف العشر الأواخر ...
"Whoever was in itikaf with me, let him observe itikaf in the last ten."
The last ten begin with the 21st night.
Sahih Muslim 1173
Sahih... إذا أراد أن يعتكف صلى الفجر ثم دخل معتكفه ...
"When he wanted to begin itikaf, he prayed Fajr and then entered his place of itikaf."
Most scholars explain this as entering his private tent after already being in the masjid.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Sawm, chapter on itikaf. The sunnah itikaf begins before sunset on the 20th and ends with the Eid moon.
- al-Majmu' (Nawawi), Kitab al-I'tikaf. Nawawi's explanation of the hadith of entering after Fajr.
- Mukhtasar Khalil with al-Sharh al-Kabir, Bab al-I'tikaf. The Maliki recommendation to remain until the Eid prayer.
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.