Of all the thousands of things the Prophet ﷺ said, Imam al-Bukhari chose to open his great collection with this one. Imam an-Nawawi opened his forty with it too. The early scholars said a person could weigh a third of their whole religion on this single sentence.
Because it answers a question you meet every single day, usually without noticing it: not what are you doing, but why. Two people can stand in the very same row, pray the very same prayer, and be worlds apart before Allah. The difference is invisible to everyone but Him. It lives in the heart.
Where this hadith comes from
It was narrated by 'Umar ibn al-Khattab (ra), and its place in the tradition is singular. Imam al-Bukhari chose to open his entire Sahih with it, and Imam an-Nawawi opened both this collection and his larger Riyad as-Salihin with it. The early scholars treated it as one of the great axes of the religion, some saying a third, even a quarter, of all knowledge turns on it, because it governs the inner reality of every single deed.
Scholars often pair it with the fifth hadith ('whoever introduces into our affair what is not from it, it is rejected') as the two scales by which every act is weighed: this hadith weighs the inside (was it sincere?), and the fifth weighs the outside (was it according to the Sunnah?). A deed is accepted only when it passes both.
A famous account ties the wording to a man who migrated only to marry a woman called Umm Qays. Scholars question that report's chain, but it hardly matters: the hadith gives its own example of migrating 'for some worldly gain or a woman to marry,' and the lesson stands on the text itself.
The key words
What it means, line by line
'Actions are but by intention': the worth and reward of a deed before Allah hang on the intention that carries it, not on its outward form alone. The same act can be worship or mere habit, accepted or empty, depending on why it was done.
'And every man shall have only that which he intended': you receive what you truly aimed at. The one who sought Allah is given Allah; the one who sought only the world is given, at most, the world, and nothing of the Hereafter.
Then the example: two people make the very same hijrah, the same road, the same hardship, but one journeys for Allah and His Messenger and the other for a worldly prize. Each arrives exactly at the destination his heart had already chosen. The outward deed was identical; the intention decided everything. And the Qur'an makes this sincerity the entire purpose of worship:
The deed, and the heart behind it
The Prophet ﷺ does not say that actions are nothing. He says they are weighed by the intention that carries them. A deed is like a body, and the intention is its soul. A magnificent act done for the eyes of people can be an empty shell, and a small act done for Allah can be heavy on the scales.
This is why one word, hijrah, the great migration the Companions made, appears twice in the hadith with two completely different endings. The road was the same. The dust, the danger, the home left behind, all of it the same. But one person walked it for Allah and His Messenger, and another walked it for something of this world. Each arrived exactly where their heart had already been pointed.
Sincerity is the soul of worship
Naming the destination by the intention is what the scholars call ikhlas, sincerity: that your worship is for Allah alone, and not for an audience. It is not one small virtue sitting beside the others. It is the thing that makes worship into worship, the difference between a living deed and an empty shell.
The quiet thief
If sincerity is the soul of a deed, then its opposite is the quiet thief that empties the deed from the inside: doing an act of worship to be seen, to be praised, to be thought well of. The danger of it is that it leaves the outside looking perfect. The prayer is still beautiful, the charity still generous, the words still wise. Only the heart, and the One who reads it, know that the deed has been hollowed out.
So the work of this hadith is never finished in a single day. Each time you begin something good there is a small, silent question to ask: for whom? The Prophet ﷺ is teaching you to keep returning to that question, gently, for the whole of your life.
The gift hidden inside it
Here is the mercy in the hadith. If intention can empty a deed, intention can just as easily fill one. The same principle that warns you also lifts you: your ordinary, permissible, unremarkable day can become a life of worship, simply through why you live it.
The meal eaten to have the strength to obey Him. The work done to keep a family honest and cared for. The sleep taken so you can rise for Him in the morning. Nothing on your calendar has to change. Where the heart is aimed changes everything.
Carry this with you
If you keep only one sentence from all forty, keep the first one.
Allah weighs the why, not only the what.
Two identical deeds can be worlds apart. The intention is the soul of the act.
Sincerity (ikhlas) is for Him alone.
Worship aimed at an audience is a body without a soul. Aim it at Allah.
Beware the quiet thief.
Doing good to be seen empties the deed while leaving its shell intact. Keep asking: for whom?
Ordinary days can become worship.
Eating, working, resting: intend them for Allah and the whole day turns into something He rewards.
A du'a to carry
قُلْ إِنَّ صَلَاتِى وَنُسُكِى وَمَحْيَاىَ وَمَمَاتِى لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ
Qul inna salati wa nusuki wa mahyaya wa mamati lillahi Rabbil-'alamin
Say, 'Indeed, my prayer, my rites of sacrifice, my living and my dying are for Allah, Lord of the worlds.' (Al-An'am 6:162)
A du'a as you begin again
The first of the forty does not ask you to do more. It asks you to mean what you already do: to take the prayer, the giving, the kindness, even the resting and the working, and to hand all of it quietly to Allah.
That is the secret the hadith guards. A small, hidden turning of the heart can lift an ordinary life into a life of worship, or, if it is neglected, leave even great deeds weightless. The Prophet ﷺ placed this hadith first so that everything after it would have a soul.
O Allah, make our deeds sincere, for Your face alone. Purify our intentions of the wish to be seen, and let even our ordinary days be lived for You. Indeed our prayer, our worship, our living and our dying are for You, Lord of the worlds. Ameen.
The hadith (Arabic matn and English) is from sunnah.com: narrated by 'Umar ibn al-Khattab (ra), Sahih al-Bukhari 1 and Sahih Muslim 1907, graded sahih (agreed upon). Qur'an citations (98:5 and 6:162) are in Uthmani script verified via quran.ai (edition ar-uthmani-minimal) with the Saheeh International translation (en-sahih-international). Per this pillar's editorial policy, the explanation stays with the creedal and spiritual meaning of the hadith (sincerity, the heart, intention) and deliberately does not enter the fiqh of niyyah (whether intention is verbalised, its timing within acts of worship, and the like); those belong to the fuqaha. FOR SCHOLAR REVIEW: confirm the rendering of the matn, the attribution, and that the treatment of ikhlas and riya' is sound before publication.