Published on

What to Do If You Forget a Rakat: Sajdah Sahw Explained

Authors
  • Ahmad
    Name
    Ahmad
    Role
    Senior Marketing Manager, Islamic education • Deen Back

بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ

In the name of God, the Most Gracious, the Most Merciful.

You have been praying. Somewhere in the middle, a thought crept in — work, a conversation, something you need to do. And now you are giving salam and something feels off. Did you pray three rakats or four?

Or worse: you gave the first salam, and your neighbor nudged you. "You only prayed three."

First: breathe. Forgetting a rakat does not invalidate your prayer. Islam has a clean, simple correction mechanism for this — it is called sajdah sahw (the two prostrations of forgetfulness). Here is everything you need to know.

The Short Answer

If you forget a rakat and realize before giving salam: complete the missing rakat, then perform two extra prostrations before or after the final salam (scholars differ on timing).

If you forget a rakat and only realize after salam: stand up, complete the missing rakat, and perform two prostrations of forgetfulness.

If you added an extra rakat by mistake: perform two prostrations of forgetfulness after the salam.

If you are unsure of the count: assume the lesser number, complete what might be missing, then perform the two prostrations.

The Prophet ﷺ said: "If one of you is uncertain in his prayer and does not know how much he has prayed, he should discard his doubt and base his prayer on what he is certain of, then prostrate twice before giving salam." (Muslim 571)

The Evidence — A Famous Story

The most vivid teaching on this comes from a hadith narrated by Abu Hurairah رضي الله عنه:

The Prophet ﷺ led a prayer and gave salam after only two rakats of Dhuhr. A man named Dhul-Yadayn said: "O Messenger of Allah, has prayer been shortened or have you forgotten?" The Prophet asked the Companions to confirm. They confirmed the mistake. The Prophet ﷺ then stood, completed the two remaining rakats, gave salam, said Allahu Akbar, prostrated, sat up, said Allahu Akbar, and prostrated again — then gave another salam. (Bukhari 1229)

This hadith establishes the ruling beyond doubt: the Prophet himself forgot a rakat and corrected it without drama, embarrassment, or repeating the entire prayer from scratch. The sunnah is the correction, not the crisis.

The Details: Common Cases

Case 1 — You forgot to complete a rakat and realize mid-prayer: If you forgot tashahhud in the middle and are now standing in a new rakat, most scholars say: continue the prayer (do not go back), and perform two prostrations of forgetfulness before your final salam.

Case 2 — You prayed only 3 rakats of Dhuhr and gave salam, then realized: Stand up immediately (within a short time — before doing other things). Complete the fourth rakat as if continuing the prayer. Then perform two prostrations before or after the final salam, depending on madhab. Give salam.

Case 3 — You prayed 5 rakats of Dhuhr by mistake: If you gave salam and someone tells you, or you realize immediately: you perform two prostrations after the salam. Your prayer counted — the extra rakat is forgiven through the sajdah sahw.

Case 4 — You doubt the count (was it 2 or 3 rakats?): Act on the number you are certain of — the lower one. If you are certain of at least 2 but unsure about 3, assume 2 and complete 2 more. Then perform sajdah sahw before the final salam.

How to Perform Sajdah Sahw

  1. After reaching the final tashahhud (or after salam in some cases), say Allahu Akbar
  2. Prostrate (sujood) once — the same as your normal prostration
  3. Rise to sitting position, say Allahu Akbar
  4. Prostrate again — one more sujood
  5. Sit up and give the final salam

That is it. Two extra prostrations, each like your normal sujood. No special words beyond the standard sujood dhikr — say Subhana Rabbiyal A'la as you would in any prostration.

Before or After Salam?

This is the main point of scholarly difference:

  • Maliki school: sajdah sahw is always before the salam
  • Hanbali school: for forgetting (shortfall), before salam; for adding extra, after salam
  • Shafi'i and Hanafi schools: sajdah sahw is generally after the salam

All positions are valid and from authentic evidence. Follow the madhab you normally follow, or the stronger evidence as you understand it. The prayer is valid in either case.

Do Not Let Doubt Win

Waswas — obsessive doubt — is shaytan's primary weapon in salah. It makes a normal prayer feel like a minefield. "Did I say that correctly? Was that three or four? Did I miss a word?" Left unchecked, it can grow into a condition where simple prayers become exhausting ordeals.

The principle against waswas is fundamental: once you have acted on a sufficient level of certainty, do not revisit it. The Prophet ﷺ said: "If one of you feels something in his stomach, and is uncertain whether something came out of him or not — let him not leave the mosque until he hears a sound or detects a smell." (Muslim 362)

The principle: certainty is not removed by doubt. If you prayed with a clear intention and reasonable attention, your prayer is valid. If a genuine objective mistake occurred — you know you prayed 3 instead of 4 — correct it with sajdah sahw. But if it is the whisper of doubt rather than a genuine count discrepancy, ignore it and complete your prayer.

Build a Prayer Habit Free From Doubt and Anxiety

DeenBack helps you establish consistent, confident salah — tracking your prayers and helping you build the habit of praying with presence rather than panic. One streak at a time.

Download on the App StoreGet it on Google Play

Free download. Premium features available in-app.

Quick Reference

SituationWhat to Do
Forgot a rakat, realized before salamComplete the missing rakat, then do sajdah sahw
Forgot a rakat, realized after salamStand up, complete the missing rakat, then do sajdah sahw
Added an extra rakatPerform sajdah sahw after salam
Doubt about countAssume lower number, complete, then do sajdah sahw
Forgot middle tashahhud (only)Continue prayer, do sajdah sahw before final salam

Common Questions

What if I am praying behind an imam and he forgets a rakat? Follow the imam. If the imam performs sajdah sahw, follow him in the two prostrations. Your prayer is valid as long as you followed the imam correctly throughout. You are not responsible for the imam's mistakes.

Can I still pray if I realize a mistake days later? If a prayer was prayed with valid intention and the required elements were covered, it is valid. Missing a rakat that you compensated for at the time is covered by sajdah sahw. If you realize after leaving that you definitely left out a complete pillar of prayer — like sujood itself — scholars differ on whether the prayer needs repeating. Consult a local scholar for this specific case.

What about Witr prayer — does sajdah sahw apply? Yes. Witr is obligatory by the Hanafi school and highly recommended by others — in either case, sajdah sahw applies to it if mistakes occur.

Does missing the iftitah takbir (opening Allahu Akbar) invalidate the prayer? The opening takbir is a pillar of prayer — missing it means the prayer did not begin validly. This is not correctable by sajdah sahw — you would need to restart the prayer. The opening takbir is the one element where "forgetting" effectively means the prayer was not entered. See how to pray salah correctly for a full breakdown of prayer pillars vs. obligations vs. sunnahs.

Is it embarrassing if this happens in congregation? No — and the hadith of the Prophet himself making this mistake in front of the Companions settles that question definitively. The Prophet completed the correction calmly and continued. You can do the same.

Confident Prayer Is the Goal

The rulings around forgotten rakats are designed to remove anxiety, not add to it. Islam does not want your prayer to be a performance under pressure. It wants your prayer to be a genuine conversation with Allah, where imperfections are handled with built-in mercy rather than catastrophized.

Know sajdah sahw. Practice the steps. Then stop worrying about forgetting rakats — and start focusing on actually being present in your prayer.

For related guidance on maintaining presence and avoiding mistakes in prayer, see how to stop bad thoughts in salah. Understanding what actually what nullifies prayer — as opposed to what merely requires sajdah sahw — helps you distinguish between mistakes that end the prayer and those that are simply corrected. And building the consistent post-prayer routine through tasbih after salah naturally extends your presence in salah beyond the final salam.

Pray With Confidence, Track With Purpose

DeenBack helps you build confident, consistent salah habits — so prayer feels like relief, not a test you might fail. Start your prayer streak today.

Download on the App StoreGet it on Google Play

Free download. Premium features available in-app.

Frequently Asked Questions

What is sajdah sahw?

Sajdah sahw means the two prostrations of forgetfulness — a specific correction performed in or after the prayer to compensate for mistakes such as forgetting a rakat, adding an extra one, or forgetting certain elements like tashahhud.

When do I perform sajdah sahw?

When you realize you forgot a rakat, you complete the missing rakat first, then perform two extra prostrations before or after the final salam, depending on the school of thought you follow.

What if I add an extra rakat by mistake?

If you complete an extra rakat by mistake, perform two prostrations of forgetfulness (sajdah sahw) after the final salam to compensate. Your prayer is still valid.

What if I am not sure whether I prayed 2 or 3 rakats?

Act on the lesser number (certainty). If you doubt whether you prayed 2 or 3 rakats of Dhuhr, assume 2 and complete the remaining two rakats, then perform sajdah sahw. Certainty is not removed by doubt.

Does forgetting a rakat invalidate the whole prayer?

No. Forgetting a rakat does not invalidate prayer — that is exactly why sajdah sahw exists. The mistake is corrected through the compensatory prostrations, and the prayer is valid.