The short answer
Sajdah sahw (the prostration of forgetfulness) is the name for two prostrations, found in the two reports below: before the salam in Sahih al-Bukhari 1224 and after it in Sahih al-Bukhari 1226, both graded sahih. The Hanafi work al-Hidayah places them after the salam and the Shafi'i al-Majmu before it, while the Maliki al-Risalah and the Hanbali al-Mughni divide the cases.
How do you do sajdah sahw in each school?
Each row is one school's method, taken from one of its works. Each row is a complete method on its own: the rows are four separate methods, not steps to combine. If you are not sure which school you follow, ask a teacher you trust.
| School and work | When | The steps |
|---|---|---|
| Hanafial-Marghinani, al-Hidayah 1/74 | After the salam, for an addition or an omission. 4 |
Al-Hidayah calls sajdah sahw wajib, and says the difference with al-Shafi'i over its timing is about which is preferable. |
| MalikiIbn Abi Zayd, al-Risalah, as quoted in al-Thamar al-Dani pp. 164 to 167 | Before the salam for an omission, or an omission with an addition. After the salam for an addition alone. 5 | Omission, or omission with addition
Addition alone
|
| Shafi'ial-Nawawi, al-Majmu 4/155 and 4/161 | Before the salam, for an addition or an omission. 6 |
Al-Shirazi's text, which al-Majmu explains, calls sajdah sahw sunnah. |
| HanbaliIbn Qudamah, al-Mughni 2/12 and 2/18 | Before the salam, except two cases after it: a salam given with part of the prayer missing, and an imam who builds on his strongest assumption. 7 | After a salam given too early, if remembered before a long interval and before wudu breaks
Every other case
|
The works also differ on how firm the timing is. Al-Marghinani, in al-Hidayah, says the Hanafi and Shafi'i difference is over which timing is preferable 4. Al-Nawawi, in al-Majmu, reports two routes in the Shafi'i school. In the first, the soundest saying is that prostrations delayed until after the salam do not count. In the second, both timings are valid and the sayings concern which is better 6. Ibn Qudamah, in al-Mughni, reports two narrations from Ahmad on whether someone who prayed five rakats prostrates before or after the salam 7.
Which mistakes did the Prophet correct with two prostrations?
Two reports in Sahih al-Bukhari describe two different mistakes, and they place the prostrations on different sides of the salam.
'Abdullah ibn Buhaynah, may Allah be pleased with him, reports that the Prophet led them in two rakats of one of the prayers, then stood up without sitting, and the people stood with him. When he had completed the prayer and they were waiting for his salam, he said the takbir before the salam, made two prostrations while sitting, then gave the salam. The report is graded sahih (authentic)
1AuthenticSahih al-Bukhari 1224
.صَلَّى لَنَا رَسُولُ اللَّهِ صلى الله عليه وسلم رَكْعَتَيْنِ مِنْ بَعْضِ الصَّلَوَاتِ ثُمَّ قَامَ فَلَمْ يَجْلِسْ، فَقَامَ النَّاسُ مَعَهُ، فَلَمَّا قَضَى صَلاَتَهُ وَنَظَرْنَا تَسْلِيمَهُ كَبَّرَ قَبْلَ التَّسْلِيمِ فَسَجَدَ سَجْدَتَيْنِ وَهُوَ جَالِسٌ ثُمَّ سَلَّمَ
'Abdullah ibn Mas'ud, may Allah be pleased with him, reports that the Prophet prayed Dhuhr as five rakats. He was asked whether something had been added to the prayer, said "What is that?", and was told he had prayed five. He then made two prostrations after he had given the salam. The report is graded sahih (authentic)
2AuthenticSahih al-Bukhari 1226
.صَلَّى الظُّهْرَ خَمْسًا فَقِيلَ لَهُ أَزِيدَ فِي الصَّلاَةِ فَقَالَ " وَمَا ذَاكَ ". قَالَ صَلَّيْتَ خَمْسًا. فَسَجَدَ سَجْدَتَيْنِ بَعْدَ مَا سَلَّمَ
| Report | What happened | What it leaves open |
|---|---|---|
| Sahih al-Bukhari 1224 | He stood after two rakats without sitting, then made two prostrations before the salam. 1 | Which prayer it was, what he recited in the sitting, and a rule for every omission. |
| Sahih al-Bukhari 1226 | He prayed five rakats of Dhuhr and made two prostrations after the salam. 2 | What to do when an extra rakat is noticed during the prayer, and a rule for every addition. |
| Sahih Muslim 571a | Words of the Prophet on doubting between three and four: build on certainty and prostrate twice before the salam. 3 | Doubts after the prayer, doubts that keep returning, and a case where one side seems more likely. |
What if I forget the first sitting?
An illustration: you rise after the second rakat of a four-rakat prayer and realise, part of the way up, that you did not sit for the tashahhud. Each work answers by how far you have risen.
| School and work | What the work says |
|---|---|
| Hanafial-Hidayah 1/75 | Remembered while still closer to sitting: return, sit and recite the tashahhud, and al-Hidayah gives the sounder view as no sajdah sahw. Closer to standing: do not return, and make sajdah sahw. 8 |
| Malikial-Risalah p. 39 | Return as long as the hands and knees have not left the ground. Once they have, carry on without returning, and prostrate before the salam. 9 |
| Shafi'ial-Majmu 4/125 and 4/140 | Al-Nawawi gives the school position: once upright, do not return; otherwise return. Al-Shirazi's text says leaving the first tashahhud through forgetfulness calls for sajdah sahw. 10 |
| Hanbalial-Mughni 2/17 and 2/20 | Remembered before standing upright: return to the tashahhud, which Ibn Qudamah says is required. Upright but not yet reciting: better not to sit, though sitting is allowed. Once reciting: do not return. Al-Khiraqi's text lists standing where one should sit among the lapses prostrated for before the salam. 117 |
The passages read do not give a measurement for "closer to standing" or "upright". If you are unsure how far you had risen, a teacher of your school can tell you how its work applies.
What if I am unsure how many rakats I have prayed?
Abu Sa'id al-Khudri, may Allah be pleased with him, reports the Prophet's words on someone who doubts in his prayer, not knowing whether he has prayed three rakats or four. He should cast the doubt aside, build on what he is certain of, then make two prostrations before he gives the salam. If he had prayed five, they make his prayer even; if he had prayed four, they are a humiliation for the devil. The report is graded sahih (authentic)
3AuthenticSahih Muslim 571a
.إِذَا شَكَّ أَحَدُكُمْ فِي صَلاَتِهِ فَلَمْ يَدْرِ كَمْ صَلَّى ثَلاَثًا أَمْ أَرْبَعًا فَلْيَطْرَحِ الشَّكَّ وَلْيَبْنِ عَلَى مَا اسْتَيْقَنَ ثُمَّ يَسْجُدُ سَجْدَتَيْنِ قَبْلَ أَنْ يُسَلِّمَ فَإِنْ كَانَ صَلَّى خَمْسًا شَفَعْنَ لَهُ صَلاَتَهُ وَإِنْ كَانَ صَلَّى إِتْمَامًا لأَرْبَعٍ كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ
The four works do not all apply this report in the same way, as the table shows.
| School and work | What the work says |
|---|---|
| Hanafial-Hidayah 1/76 | In al-Hidayah, the first time it happens: start the prayer again. If it happens often: build on your strongest view. With no view: build on certainty (the fewer), sitting at each point that may be the end of the prayer. 8 |
| Malikial-Risalah pp. 38 to 39 | Build on certainty, pray the rakat in doubt, and prostrate after the salam. Someone overcome by frequent doubt ignores it and prostrates after the salam. 9 |
| Shafi'ial-Majmu 4/106 and 4/155 | Al-Shirazi's text: take the fewer and pray what remains, citing Abu Sa'id's hadith. Al-Nawawi gives the school's timing as before the salam. 106 |
| Hanbalial-Mughni 2/13, 2/17 and 2/19 | Praying alone: build on certainty (the apparent school position, in Ibn Qudamah's words) and prostrate before the salam (al-Khiraqi). An imam: build on the strongest assumption and prostrate after the salam (al-Khiraqi); another narration from Ahmad has him build on certainty and prostrate before it. 117 |
Doubts that keep coming back, and doubts that arise after the prayer has ended, have their own rules in some of these works. If doubt keeps interrupting your prayer, a scholar you trust can advise you on how to handle it.
The prostration made when reciting certain verses of the Quran is a different act: see Sajdah tilawat. For the whole prayer in order, see How to pray Salah.
Leading my younger brothers in prayer at home, I lost count of the rak'ahs and froze. My younger brother whispered that it was three from behind me. Afterwards we argued about what I should have done, and I went and looked it up properly.
Try it: the reports and the works
Four checks, each with its source.
1In Sahih al-Bukhari 1224, when did the two prostrations come?
Answer: Before the salam. 'Abdullah ibn Buhaynah reports that the Prophet said the takbir before the salam, made two prostrations while sitting, then gave the salam. Source 1
2In Sahih al-Bukhari 1226, what had happened before the two prostrations after the salam?
Answer: He had prayed Dhuhr as five rakats. 'Abdullah ibn Mas'ud reports that the Prophet prayed Dhuhr as five rakats, was told so, and made two prostrations after he had given the salam. Source 2
3Which work places sajdah sahw after the salam for an addition and before it for an omission?
Answer: The Maliki al-Risalah. The Maliki al-Risalah divides the cases this way. Al-Hidayah puts both after the salam, and al-Majmu gives the Shafi'i position as before it. Source 5
4In al-Hidayah, what does someone do who forgets the first sitting and is closer to standing?
Answer: Carries on and makes sajdah sahw. Al-Hidayah says he does not return when closer to standing, and makes sajdah sahw. Source 8
Questions people ask
Does sajdah sahw apply in voluntary prayers?
Al-Shirazi's text in the Shafi'i work al-Majmu says voluntary and obligatory prayers are the same in sajdah sahw. Al-Abi al-Azhari's Maliki commentary al-Thamar al-Dani says it applies in obligatory and voluntary prayers, following al-Mudawwanah. The Hanafi and Hanbali works were not checked on this point, so ask a teacher of your school.
If I make several mistakes, do I prostrate more than twice?
Al-Nawawi's al-Majmu, a Shafi'i work, reports the school's scholars saying that two prostrations cover several lapses of any kind, and that more than two is not allowed. The Hanafi, Maliki and Hanbali works were not checked on this point, so a teacher of your school is the person to ask.
Sources
Every claim on this page comes from one of these. A grading is shown with the collection that gives it, and a scholar's name is given where a grader is quoted; we do not grade hadith ourselves.
- 1
'Abdullah ibn Buhaynah reports that the Prophet led them in two rak'ahs of a prayer, stood up without sitting, the people stood with him, and when he had completed the prayer and they were waiting for his salam he said takbir before the salam, made two prostrations while sitting, then gave the salam
Sahih al-Bukhari 1224 Book 22, Hadith 1
Authentic: in Sahih al-Bukhari
- 2
'Abdullah ibn Mas'ud reports that the Prophet prayed Dhuhr as five rak'ahs; he was asked whether the prayer had been increased, said 'What is that?', was told he had prayed five, and made two prostrations after he had given the salam
Sahih al-Bukhari 1226 Book 22, Hadith 3
Authentic: in Sahih al-Bukhari
- 3
Abu Sa'id al-Khudri reports the Prophet saying that one who doubts in his prayer, not knowing whether he prayed three or four, should cast the doubt aside, build on what he is certain of, then prostrate twice before giving the salam; if he had prayed five they make his prayer even, and if he had prayed four they humiliate the devil
Sahih Muslim 571a Book 5, Hadith 110
Authentic: in Sahih Muslim
- 4
Al-Marghinani, in al-Hidayah, says sajdah sahw is two prostrations after the salam, for addition and omission alike, followed by the tashahhud and then the salam; that the difference with al-Shafi'i (before the salam) is over which is preferable; that the salam before it is two salams and the blessing on the Prophet and supplication come in the sahw sitting, each as the sound position (al-sahih); and that sajdah sahw is wajib, as the sound position.
Al-Marghinani, al-Hidayah, vol. 1 p. 74 (shamela.ws page 97) Read on shamela.ws on 28 October 2026 (a typed transcription, not checked against the printed book). Record: scholarly-sahw-hanafi-hidayah-method.
- 5
Ibn Abi Zayd, in al-Risalah (its text as quoted in al-Abi al-Azhari's al-Thamar al-Dani), says every lapse of addition is corrected by two prostrations after the salam, with a tashahhud and salam for them; every lapse of omission by two prostrations before the salam once the tashahhud is complete, then the tashahhud again and the salam (another view: the tashahhud is not repeated); and omission with addition before the salam.
Ibn Abi Zayd, al-Risalah, as quoted in al-Abi al-Azhari, al-Thamar al-Dani, pp. 164 to 167 Read on shamela.ws on 28 October 2026 (a typed transcription, not checked against the printed book). Record: scholarly-sahw-maliki-risalah-method.
- 6
Al-Nawawi, in al-Majmu, gives the school position (al-madhhab) that sajdah sahw comes before the salam, for addition and omission, and describes it as two prostrations with a sitting between them, like the prayer's prostrations in form and words, followed by sitting in tawarruk until the salam; al-Shirazi's text, which al-Majmu explains, calls it sunnah and says its place is before the salam.
Al-Nawawi, al-Majmu, vol. 4 pp. 141, 151, 153 to 155 and 161 Read on shamela.ws on 28 October 2026 (a typed transcription, not checked against the printed book). Record: scholarly-sahw-shafii-majmu-method.
- 7
Al-Khiraqi's text with Ibn Qudamah's commentary, in al-Mughni, puts all sajdah sahw before the salam according to Ahmad, except two cases with a text for after the salam: one who gave the salam with part of the prayer missing, and an imam who builds on his strongest assumption; in the first, Ibn Qudamah has him complete the prayer, recite the tashahhud and give the salam, make the two prostrations, then recite the tashahhud and give the salam (al-Khiraqi's order puts the salam before the prostrations).
Ibn Qudamah, al-Mughni, vol. 2 pp. 12 and 17 to 18 Read on shamela.ws on 28 October 2026 (a typed transcription, not checked against the printed book). Record: scholarly-sahw-hanbali-mughni-method.
- 8
Al-Marghinani, in al-Hidayah, says one who forgets the first sitting returns and sits if he is still closer to sitting, but does not return if he is closer to standing, and then makes sajdah sahw; and that one who doubts whether he prayed three or four starts again if it is the first time, builds on his strongest view if it happens to him often, and builds on certainty if he has no view.
Al-Marghinani, al-Hidayah, vol. 1 pp. 75 to 76 Read on shamela.ws on 28 October 2026 (a typed transcription, not checked against the printed book). Record: scholarly-sahw-hanafi-hidayah-cases.
- 9
Ibn Abi Zayd, in al-Risalah, says one who stands up after two rak'ahs returns as long as his hands and knees have not left the ground, and once they have he carries on and prostrates before the salam; and one who does not know whether he prayed three or four builds on certainty, prays the rak'ah he doubted and prostrates after his salam.
Ibn Abi Zayd, al-Risalah, pp. 38 to 39 Read on shamela.ws on 28 October 2026 (a typed transcription, not checked against the printed book). Record: scholarly-sahw-maliki-risalah-cases.
- 10
Al-Shirazi's text in al-Majmu says one who doubts how many rak'ahs he prayed takes the fewer and prays what remains, that one who leaves the first tashahhud and remembers after standing upright does not return to it, and that leaving the first tashahhud through forgetfulness calls for sajdah sahw; al-Nawawi gives the school position as returning only if he has not yet stood upright.
Al-Nawawi, al-Majmu, vol. 4 pp. 106, 122, 125 and 140 Read on shamela.ws on 28 October 2026 (a typed transcription, not checked against the printed book). Record: scholarly-sahw-shafii-majmu-cases.
- 11
Ibn Qudamah, in al-Mughni, says one who forgets the first tashahhud must return to it if he remembers before standing upright, had better not sit if he is upright but has not begun reciting (though sitting is allowed), and may not return once he has begun reciting; al-Khiraqi's text has a doubting imam build on his strongest assumption and prostrate after the salam, and Ibn Qudamah gives the apparent school position that a solitary worshipper builds on certainty.
Ibn Qudamah, al-Mughni, vol. 2 pp. 13, 19 and 20 Read on shamela.ws on 28 October 2026 (a typed transcription, not checked against the printed book). Record: scholarly-sahw-hanbali-mughni-cases.
Next
For your own situation, ask a scholar you trust.
Join the email list
New guides by email, now and then. No spam, and you can leave at any time.
Ilmwell is free and kept going by readers. See how to support it.