You come up from sujood and the thought lands: was that the second rak'ah, or the third? The more you reach for the answer, the less certain it becomes, and now you are standing there running a tally instead of praying.
This is such a common experience that the sunnah addresses it directly and specifically. There is a clear procedure. Learn it once and the panic disappears — because you will know that losing count is a solvable, minor problem, not a ruined prayer.
Do not speak, and do not walk away. If one number feels clearly more likely, go with it. If you genuinely cannot tell, assume the lower number and pray the remaining rak'ah. Either way, finish with two extra prostrations — sujood as-sahw. Your prayer is valid.
- First: don't break the prayer
- Work out which of two cases you are in
- Case A — one number feels more likely
- Case B — you genuinely have no idea
- Worked examples
- If you are praying behind an imam
- If you only realise after finishing
- When the doubt never stops
- Preventing it in the first place
- Common questions
First: don't break the prayer
The instinctive reaction — give salam and start over — is usually the wrong one, and it is worth resisting for a practical reason as much as a legal one: someone who restarts every time they lose count will start dreading the longer prayers.
So, while you are standing there uncertain:
- Don't speak. Talking deliberately invalidates the prayer.
- Don't leave your place or turn away from the qibla.
- Don't give salam to end early.
- Do stay in the prayer and take a few seconds to think. A short pause to work it out is fine.
The prayer is still intact. You are simply resolving a question inside it.
Work out which of two cases you are in
Everything turns on one question: does one number feel more likely than the other, or are they genuinely equal?
Scholars call the first situation ghalabat al-dhann — a preponderant impression. Not certainty, just a real lean. The second is true doubt, where the two possibilities sit at fifty-fifty and no amount of thinking moves them.
| Your state | What to do | Then |
|---|---|---|
| One number feels more likely | Act on that number and complete the prayer | Sujood as-sahw |
| Genuinely 50/50 | Build on the lower number and pray the remainder | Sujood as-sahw |
Case A — one number feels more likely
If, after a moment's thought, you settle on “that was probably the third,” act on it. Continue as though it were the third, complete the prayer normally, and perform sujood as-sahw.
You do not need certainty here. A reasonable, settled impression is enough — that is the whole point of the ruling. It exists so that ordinary human forgetfulness does not cost you the prayer.
Case B — you genuinely have no idea
When neither number is more likely, the principle is build on certainty. You are certain you prayed the lower number, so treat that as the truth and pray the remainder.
This is the substance of a well-known instruction from the Prophet ﷺ, reported in Sahih Muslim on the authority of Abu Sa'id al-Khudri: one who is unsure how much he has prayed should discard the doubt, build on what he is certain of, and prostrate twice before giving salam. If the prayer turns out to have been complete, the additional rak'ah counts as voluntary; if it was short, the rak'ah completes it. Either way the two prostrations settle the matter.
Building on the lower number can never leave you with too few rak'ahs — the worst case is one extra, and sujood as-sahw exists precisely to cover that. It is the option that is safe in both directions, which is why it is the default when you cannot decide.
Worked examples
“Was that two or three, in Isha?”
No lean either way. Assume two. Sit for tashahhud where it belongs after the second, then pray the remaining two rak'ahs, and perform sujood as-sahw before salam.
“Was that three or four, in Dhuhr?”
No lean either way. Assume three and pray one more rak'ah. Then sujood as-sahw. If it really was the fourth, the extra rak'ah becomes voluntary and the prostrations compensate.
“I think I stood up without sitting for the first tashahhud.”
If you have already stood fully upright, do not sit back down — continue the prayer and perform sujood as-sahw at the end. If you have only begun to rise and have not yet straightened, return to the sitting position and continue normally.
“I prayed four rak'ahs of Maghrib.”
An addition. As soon as you realise, return to the sitting position, complete the tashahhud, and perform sujood as-sahw. If you realised only after salam, perform the two prostrations then, provided you are still in place.
Let the app hold the number
Ar-Rayyan watches for each sujood and counts your rak'ahs as you pray — so if your mind wanders, the count doesn't. Place your phone in front of you, pray as normal, and check the screen only if you need to. It runs entirely on your device: no video is recorded, stored or sent anywhere.
If you are praying behind an imam
Follow the imam. Your own doubt does not apply while you are following — the imam carries the count for the congregation, and if he errs and performs sujood as-sahw, you do it with him.
If the imam makes a clear mistake, the congregation alerts him: men say “SubhanAllah,” women clap the back of one hand against the palm of the other. It is a correction, not an interruption.
If you joined late, note that your doubt about your own make-up rak'ahs — the ones you pray alone after the imam's salam — follows the normal rules above.
If you only realise after finishing
How much time has passed is what matters.
- Straight away — still on the prayer mat, still facing the qibla, nothing said or done in between: stand up, pray the missing rak'ah(s), then perform sujood as-sahw and give salam.
- A long gap — you have left, spoken, become occupied with other things: pray the prayer again from the beginning.
Where exactly the line falls between the two is a point of scholarly detail. The reasonable rule of thumb is whether you are still in the state and place of the prayer.
When the doubt never stops
Some people do not lose count occasionally — they doubt every prayer, every time, and repeat prayers over and over trying to reach a certainty that never arrives.
That is a different thing, and it is treated differently. It is waswasa: intrusive whispering, well known and long discussed in the tradition. The guidance is consistent and might feel counter-intuitive: ignore it. Do not act on it, do not investigate it, do not repeat the prayer. Proceed on the assumption that your prayer is sound and move on.
Compulsive doubt around worship can be genuinely distressing, and it is not a sign of weak faith. Speak to a knowledgeable and compassionate scholar — and if it is significantly affecting your daily life, there is nothing wrong with also speaking to a mental-health professional. Many people have been helped by both.
Preventing it in the first place
Losing count is usually a symptom of attention drifting, so most of what helps is really about presence:
- Vary what you recite. Different surahs in each rak'ah give your memory distinct landmarks. Four identical rak'ahs are four identical memories.
- Slow down. Rushed prayer blurs together; unhurried prayer is far easier to track.
- Pray in congregation where you can. The imam carries the count.
- Deal with the distraction beforehand — silence the phone, use the bathroom, put the thing you keep thinking about on a list before you begin.
- Use a counter if the problem is persistent. Prayer beads track dhikr; an app like Ar-Rayyan can track rak'ahs without you having to hold a number in your head.
This is a plain-language summary of mainstream positions, written to help in the moment. It is not a fatwa, and the schools differ on some details — notably whether the two prostrations come before or after salam, which is covered in the sujood as-sahw guide. For your own situation, ask a qualified scholar or your local imam.
Common questions
Is my prayer still valid if I lost count?
Yes. Following the procedure above — acting on the stronger impression or building on the lower number, then performing sujood as-sahw — leaves you with a complete and valid prayer.
Can I count rak'ahs on my fingers?
Small movements that are not excessive do not invalidate the prayer, and many people use their fingers discreetly. It is better to build concentration than to rely on it, but it is not something to feel guilty about.
What if I forgot which prayer I was praying?
Intention is formed at the start and does not need to be repeated. If you genuinely cannot recall what you began, complete it and pray the prayer you owe with a clear intention.
Does the Hanafi school say something different?
On one point, yes. In the Hanafi school, if doubt of this kind happens to you for the first time and you have no leaning at all, the prayer is repeated. If such doubt is a recurring experience, you act on the stronger impression, or build on the lower number, and perform sujood as-sahw after salam rather than before.
Do I need to make up the prayer later as well?
No. Once completed correctly with sujood as-sahw, the prayer is done. There is nothing further to make up.