Is my prayer valid if I doubted the number of rak'ahs and based it on the minimum, then doubted the number of prostrations during the same prayer and based it on the minimum, then said the taslim after the tashahhud?
The legal ruling is that when in doubt about the number of rak'ahs (units of prayer) or sujud (prostrations), the worshipper should base their prayer on the minimum certain number. This requires performing the prostration of forgetfulness (sujud al-sahw). This prostration is obligatory based on the hadith: "If one of you doubts in his prayer and does not know whether he prayed three or four rak'ahs, he should cast away doubt and build upon what he is certain of. Then, he should prostrate twice before he makes the taslim (salutation of peace)." The preferred time for this prostration is before the taslim; however, if one has already made the taslim, they should prostrate afterward. If one intentionally neglects to perform it, neither before nor after the taslim, then the prayer becomes void according to the Hanbalis. Some jurists, however, consider it to be mustahabb (recommended) rather than wajib (obligatory). Nevertheless, it is safer to repeat the prayer if one intentionally omits it.
Summarized from the full answer at Ftawy · reviewed Sep 2, 2026
Read the full answer on Ftawyhttps://ftawy.com/en/questions/143106