Named hadith
حديث إنما الأعمال بالنيات
Hadith “Innama al-A'malu bil-Niyyat”: Actions Are by Intentions
9 hadith in the six books
إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى
The reward of deeds depends upon the intentions and every person will get the reward according to what he has intended.
Umar ibn al-Khattab narrates from the pulpit that the Prophet said actions are judged by intentions and every person will have what he intended; whoever emigrated for Allah and His Messenger, his emigration is for Allah and His Messenger, and whoever emigrated for worldly gain or to marry a woman, his emigration is for what he emigrated for.
Bukhari opens his Sahih with it, and it is recorded in all six books, placed in chapters on intention in faith, oaths, divorce, ablution and fighting for worldly ends.
Narrations
More in well-known hadith by name