Muslim AppMuslim App
Prayer & Qibla

How to Pray Tahajjud: Time, Rak'ahs, Dua and Witr

How to pray tahajjud step by step: when its time begins, the best part of the night in each school, how many rak'ahs the Hanafi, Maliki, Shafi'i and Hanbali schools give, three duas from the Sunnah in full, and what to do if you already prayed witr.

Muslim App Editorial TeamBy Muslim App Editorial Team12 min read
A town asleep under a crescent moon and stars, one window lit and a mosque nearby, as dawn begins to glow on the horizon

To pray tahajjud, sleep after Isha if you can, wake in the later part of the night, make wudu, pray at least two rak'ahs, and end with witr if you have not already prayed it. Tahajjud prayer is the voluntary night prayer the Quran encourages and the Prophet ﷺ kept up; the four Sunni schools agree on its outline and differ on details such as the best hour and the number of rak'ahs.

Key takeaways

  • Time: any time after Isha until Fajr. The Hanafi, Shafi'i and Hanbali schools rate the fourth and fifth sixths of the night best; the Maliki school rates the last third best for those who usually wake then, the time of Allah's descent in Sahih al-Bukhari 1145.
  • Sleep: in the usual definition, tahajjud comes after sleep. Praying before you sleep is still rewarded night prayer (qiyam al-layl), but after sleep is better.
  • Rak'ahs: at least two light rak'ahs. Hanafis count two to eight and Malikis up to ten or twelve; Shafi'is and Hanbalis set no upper limit.
  • Witr: end with witr. If you prayed witr before sleeping and then wake up, pray an even number of rak'ahs and do not repeat it.
  • Dua: no single dua is required. On waking, say the remembrance that begins La ilaha illallahu wahdahu la sharika lah, then Allahumma-ghfir li ("O Allah, forgive me") or ask for whatever you need (Sahih al-Bukhari 1154).

What is tahajjud prayer?

Tahajjud is voluntary prayer at night after waking from sleep. The name comes from the Quran's verb fa-tahajjad, which appears only once, in this verse: "during the night wake up and pray, as an extra offering of your own, so that your Lord may raise you to a [highly] praised status" (Quran 17:79, Abdel Haleem's translation). The Prophet ﷺ said that the best prayer after the obligatory prayers is prayer at night (Sahih Muslim 1163a).

The jurists agree that night prayer is prescribed, and each school uses its own term: sunnah for the Hanafis and Hanbalis, mandub (recommended) for the Malikis and mustahabb (recommended) for the Shafi'is (Kuwaiti Encyclopedia of Islamic Jurisprudence, 34/118). A rak'ah is one unit of prayer, also written rakat or rakah.

When is tahajjud time?

Tahajjud time begins after Isha and lasts until Fajr. The Kuwaiti Encyclopedia records no disagreement that night prayer comes only after Isha, whether or not you have slept first (34/119). It ends at dawn: the Prophet ﷺ said that whoever fears dawn is near should pray one rak'ah to make his night prayer odd (Sahih al-Bukhari 990). The Shafi'i and Hanbali schools accept a one-rak'ah witr, and the Maliki school accepts it after at least two rak'ahs; the Hanafi school does not, and prays witr as three rak'ahs with one salam (Kuwaiti Encyclopedia, 27/293–294).

The later hours are better. The Prophet ﷺ said that our Lord descends to the lowest heaven every night when the last third of the night remains, and says: "Who will call on Me, so that I may answer him? Who will ask of Me, so that I may give him? Who will ask My forgiveness, so that I may forgive him?" (Sahih al-Bukhari 1145). The schools name the best time in two ways (Kuwaiti Encyclopedia, 14/88):

  • Hanafi, Shafi'i and Hanbali: the fourth and fifth sixths of the night. This follows the prayer of the Prophet Dawud (David), the prayer most loved by Allah: he slept half the night, prayed a third and slept a sixth (Sahih al-Bukhari 1131).
  • Maliki: the last third, for someone who usually wakes at the end of the night. Someone who usually sleeps until morning does better, as a precaution, to pray at the start of the night (see also 34/119).

How to find the last third of the night

In the preferred view of the jurists, the night runs from sunset (Maghrib) to true dawn (Fajr); Egypt's Dar al-Ifta sets out this view and its evidence in fatwa no. 7894. To find the last third where you live:

  1. Take the time from tonight's Maghrib to tomorrow's Fajr.
  2. Divide it by three.
  3. Subtract that third from the Fajr time. The result is when the last third begins.

For the fourth and fifth sixths, divide the night into six: that stretch runs from the midpoint of the night to one sixth before Fajr. Both move through the year; get tonight's Maghrib and Fajr times for your city from our prayer times page.

Do you have to sleep before tahajjud?

In the usual definition, yes. Ibn al-Arabi records three views on the word's meaning, one of which counts any prayer after Isha. The view that it is prayer after sleep is preferred in the Maliki school, and the Kuwaiti Encyclopedia uses it when it separates the terms: qiyam al-layl (night prayer) may or may not follow sleep, while tahajjud "is only after sleep" (14/86).

Prayer before sleep still counts: it is qiyam al-layl, valid and rewarded, though praying after some sleep is better, and the jurists do not disagree on either point (34/119). If you fear you will not wake at all, the Prophet ﷺ said: "Whoever fears that he will not get up at the end of the night, let him pray witr at its beginning" (Sahih Muslim 755a).

How many rak'ahs is tahajjud?

The minimum is two light rak'ahs, and the jurists agree on this (Kuwaiti Encyclopedia, 14/88). The Prophet ﷺ said: "When one of you gets up at night, let him begin his prayer with two light rak'ahs" (Sahih Muslim 768).

The Prophet ﷺ said night prayer is two by two (Sahih al-Bukhari 990, Sahih Muslim 749a). Malik, the Shafi'is, and Abu Yusuf and Muhammad among the Hanafis hold that praying it in twos is better; Abu Hanifa held that it is prayed in fours, citing Aisha's description of the Prophet's ﷺ prayer (34/121). In that description he did not pray more than eleven rak'ahs at night, in Ramadan or outside it: four, then four, then three (Sahih al-Bukhari 1147). The schools differ on the maximum:

MadhhabRak'ahsSource
HanafiTwo to eight: the least and the most of the Prophet's ﷺ own tahajjud (Ibn al-Humam).Kuwaiti Encyclopedia, 14/88
MalikiTwo to ten or twelve, based on reports of the Prophet ﷺ ending them with one rak'ah of witr.Kuwaiti Encyclopedia, 14/88
Shafi'iTwo at least, with no upper limit.Kuwaiti Encyclopedia, 14/89
HanbaliTwo at least, with no upper limit, as drawn from the Hanbali texts.Kuwaiti Encyclopedia, 14/89

How to pray tahajjud step by step

  1. Wake and remember Allah. Say the remembrance below (Sahih al-Bukhari 1154), then make wudu.
  2. Make your intention. Intention is in the heart; no set wording is required.
  3. Open with two light rak'ahs (Sahih Muslim 768). You can open with the supplication in Sahih Muslim 770, below.
  4. Pray each pair like any two-rak'ah sunnah prayer, ending with the tashahhud and salam, and continue in twos, or in fours as Abu Hanifa preferred; the table above gives each school's count.
  5. End with witr. The Prophet ﷺ said: "Make the last of your prayer at night witr" (Sahih al-Bukhari 998).
  6. Make dua in your own words, in the part of the night when Allah invites His servants to ask (Sahih al-Bukhari 1145).

Start small, stay consistent

The Prophet ﷺ said that the deeds most loved by Allah are the most constant, even if small (Sahih al-Bukhari 6464), and Aisha described his own practice as constant (Sahih Muslim 783a). If getting up at night is new to you, start with our guide on waking up for Fajr, then, once that is steady, add two rak'ahs in the last part of the night, before Fajr time begins, then witr.

Tahajjud dua: what to say

No single dua is required; the three below come from the Sunnah.

On waking

Ubada ibn al-Samit reported that the Prophet ﷺ said: whoever wakes at night and says these words, then says "O Allah, forgive me" or makes any supplication, will be answered; and if he makes wudu and prays, his prayer will be accepted.

لاَ إِلَهَ إِلاَّ اللَّهُ وَحْدَهُ لاَ شَرِيكَ لَهُ، لَهُ الْمُلْكُ، وَلَهُ الْحَمْدُ، وَهُوَ عَلَى كُلِّ شَىْءٍ قَدِيرٌ، الْحَمْدُ لِلَّهِ، وَسُبْحَانَ اللَّهِ، وَلاَ إِلَهَ إِلاَّ اللَّهُ، وَاللَّهُ أَكْبَرُ، وَلاَ حَوْلَ وَلاَ قُوَّةَ إِلاَّ بِاللَّهِ

Transliteration: La ilaha illallahu wahdahu la sharika lah, lahul-mulk, wa lahul-hamd, wa huwa 'ala kulli shay'in qadir. Al-hamdu lillah, wa subhanallah, wa la ilaha illallah, wallahu akbar, wa la hawla wa la quwwata illa billah.

Translation: There is no god but Allah alone, with no partner. His is the dominion and His is the praise, and He has power over all things. Praise be to Allah, glory be to Allah, there is no god but Allah, Allah is the Greatest, and there is no might and no power except through Allah.

Sahih al-Bukhari 1154

Then say Allahumma-ghfir li ("O Allah, forgive me"), or ask for whatever you need.

The Prophet's tahajjud dua

Ibn Abbas reported that when the Prophet ﷺ got up at night to pray tahajjud, he said:

اللَّهُمَّ لَكَ الْحَمْدُ أَنْتَ قَيِّمُ السَّمَوَاتِ وَالأَرْضِ وَمَنْ فِيهِنَّ، وَلَكَ الْحَمْدُ، لَكَ مُلْكُ السَّمَوَاتِ وَالأَرْضِ وَمَنْ فِيهِنَّ، وَلَكَ الْحَمْدُ أَنْتَ نُورُ السَّمَوَاتِ وَالأَرْضِ، وَلَكَ الْحَمْدُ أَنْتَ الْحَقُّ، وَوَعْدُكَ الْحَقُّ، وَلِقَاؤُكَ حَقٌّ، وَقَوْلُكَ حَقٌّ، وَالْجَنَّةُ حَقٌّ، وَالنَّارُ حَقٌّ، وَالنَّبِيُّونَ حَقٌّ، وَمُحَمَّدٌ صلى الله عليه وسلم حَقٌّ، وَالسَّاعَةُ حَقٌّ، اللَّهُمَّ لَكَ أَسْلَمْتُ، وَبِكَ آمَنْتُ وَعَلَيْكَ تَوَكَّلْتُ، وَإِلَيْكَ أَنَبْتُ، وَبِكَ خَاصَمْتُ، وَإِلَيْكَ حَاكَمْتُ، فَاغْفِرْ لِي مَا قَدَّمْتُ وَمَا أَخَّرْتُ، وَمَا أَسْرَرْتُ وَمَا أَعْلَنْتُ، أَنْتَ الْمُقَدِّمُ وَأَنْتَ الْمُؤَخِّرُ، لاَ إِلَهَ إِلاَّ أَنْتَ ـ أَوْ لاَ إِلَهَ غَيْرُكَ ـ

Transliteration: Allahumma lakal-hamd, anta qayyimus-samawati wal-ardi wa man fihinn, wa lakal-hamd, laka mulkus-samawati wal-ardi wa man fihinn, wa lakal-hamd, anta nurus-samawati wal-ard, wa lakal-hamd, antal-haqq, wa wa'dukal-haqq, wa liqa'uka haqq, wa qawluka haqq, wal-jannatu haqq, wan-naru haqq, wan-nabiyyuna haqq, wa Muhammadun ﷺ haqq, was-sa'atu haqq. Allahumma laka aslamt, wa bika amant, wa 'alayka tawakkalt, wa ilayka anabt, wa bika khasamt, wa ilayka hakamt, faghfir li ma qaddamtu wa ma akhkhart, wa ma asrartu wa ma a'lant, antal-muqaddimu wa antal-mu'akhkhir, la ilaha illa ant (or: la ilaha ghayruk).

Translation: O Allah, all praise is Yours. You are the Sustainer of the heavens and the earth and all who are in them. All praise is Yours; Yours is the dominion of the heavens and the earth and all who are in them. All praise is Yours; You are the Light of the heavens and the earth. All praise is Yours; You are the Truth, Your promise is true, the meeting with You is true, Your word is true, Paradise is true, the Fire is true, the prophets are true, Muhammad ﷺ is true, and the Hour is true. O Allah, to You I have submitted, in You I have believed, in You I have put my trust, to You I have turned, by You I have contended, and to You I have brought my case for judgment. So forgive me what I have done before and what I do after, what I have hidden and what I have done openly. You are the One who brings forward and You are the One who holds back. There is no god but You (or: there is no god other than You).

Sahih al-Bukhari 1120

The narrator was unsure which closing phrase was said. Another narration in al-Bukhari (6317) opens with anta nurus-samawati wal-ard and is a little shorter; the text above follows 1120.

Opening supplication of the night prayer

Aisha told Abu Salama ibn Abd al-Rahman that when the Prophet ﷺ rose at night, he opened his prayer with these words:

اللَّهُمَّ رَبَّ جِبْرَائِيلَ وَمِيكَائِيلَ وَإِسْرَافِيلَ فَاطِرَ السَّمَوَاتِ وَالأَرْضِ عَالِمَ الْغَيْبِ وَالشَّهَادَةِ أَنْتَ تَحْكُمُ بَيْنَ عِبَادِكَ فِيمَا كَانُوا فِيهِ يَخْتَلِفُونَ اهْدِنِي لِمَا اخْتُلِفَ فِيهِ مِنَ الْحَقِّ بِإِذْنِكَ إِنَّكَ تَهْدِي مَنْ تَشَاءُ إِلَى صِرَاطٍ مُسْتَقِيمٍ

Transliteration: Allahumma Rabba Jibra'ila wa Mika'ila wa Israfil, fatiras-samawati wal-ard, 'alimal-ghaybi wash-shahadah, anta tahkumu bayna 'ibadika fima kanu fihi yakhtalifun. Ihdini lima-khtulifa fihi minal-haqqi bi-idhnik, innaka tahdi man tasha'u ila siratin mustaqim.

Translation: O Allah, Lord of Jibril, Mika'il and Israfil, Originator of the heavens and the earth, Knower of the unseen and the seen, You judge between Your servants in what they used to differ over. Guide me, by Your leave, to the truth in what has been differed over. Indeed, You guide whom You will to a straight path.

Sahih Muslim 770

Your own dua

After the prayer, ask for what you need in your own words and seek Allah's forgiveness; that is what the hadith of the last third invites you to do (Sahih al-Bukhari 1145).

If you are weighing a decision, istikhara is a separate two-rak'ah prayer with its own supplication; see the istikhara dua.

Tahajjud and witr: which comes first?

Tahajjud comes first and witr last (Sahih al-Bukhari 998). If you fear you will not wake, pray witr after Isha, before you sleep (Sahih Muslim 755a).

If you prayed witr before sleeping and then wake for tahajjud, pray an even number of rak'ahs, as many as you wish, and do not pray witr again. This is the position of the Hanafi, Maliki and Hanbali schools and the well-known view in the Shafi'i school (Kuwaiti Encyclopedia, 27/300). The Encyclopedia cites the hadith "There are no two witrs in one night" (Jami' al-Tirmidhi 470, graded sahih by Darussalam; al-Tirmidhi calls it hasan gharib). Al-Tirmidhi notes that the other view cites it too: Ishaq and others held that you first pray one rak'ah to make the earlier witr even, then end with witr again. He judged not repeating witr the sounder view, since reports describe the Prophet ﷺ praying after witr.

Abu Hanifa held that witr is wajib: required, though below the obligatory (fard) prayers, and the Hanafi school treats it as wajib (27/290, 27/292). His students Abu Yusuf and Muhammad differed with him, and in the Maliki, Shafi'i and Hanbali schools it is an emphasized sunnah (sunnah mu'akkadah) (27/289). For how to pray witr and its qunoot, see our guide to dua qunoot.

Share

Frequently asked questions

Yes. Tahajjud time lasts until Fajr comes in, and the Prophet ﷺ described prayer at the end of the night as witnessed and better (Sahih Muslim 755a). If dawn is close, pray witr before it comes in (Sahih al-Bukhari 990). The hadith mentions a single rak'ah: the Shafi'i and Hanbali schools accept it, the Maliki school accepts it after at least two rak'ahs, and the Hanafi school prays witr as three rak'ahs (Kuwaiti Encyclopedia, 27/293–294).

About the author

Muslim App Editorial Team
Muslim App Editorial Team

Muslim App Editorial Team writes practical guides on prayer, building a consistent salah habit, and Muslim life at work and on the road. Where an article touches on religious rulings, it gives its sources and, where scholars or the four Sunni schools differ, says so rather than presenting one view as the only one; questions that depend on your situation are left to a qualified scholar. Our articles are not fatwas.

Related articles