Short answer
Yes. Making dua for another Muslim in their absence is one of the duas most likely to be answered, and an angel says "Ameen, and for you the same." You may pray for your family, friends, the whole ummah, and for non-Muslims to be guided.
Dua for other believers, living or dead, is mustahabb and reaches them by the consensus of Ahl al-Sunnah. Praying for a living non-Muslim's guidance and wellbeing is allowed; praying for forgiveness for one who died upon disbelief is not.
The four schools agree on this.
Explanation
The Prophet ﷺ said: the dua of a Muslim for his brother in his absence is answered. At his head is an angel appointed; whenever he prays for his brother with good, the angel says: Ameen, and for you the same. So when you pray for someone, you gain too.
Dua for others in the Quran. The believers pray: our Lord, forgive us and our brothers who came before us in faith (59:10). Ibrahim prayed for his parents and all believers (14:41). The angels around the Throne pray for the believers. Praying for others is part of the faith.
Who can you pray for?
- Family and friends: by name, in sujood, at the times when duas are accepted.
- The ummah: "O Allah, forgive the believing men and women." Some scholars say you get a reward for every believer included.
- Non-Muslims: you may pray for their guidance, health and good. The Prophet ﷺ prayed: "O Allah, guide the tribe of Daws and bring them."
- The deceased: dua reaches Muslims who have died. For non-Muslims who have died, see dua for a non-Muslim who died.
Tips: pray for them privately, not only to their face; mention them by name; ask for good in this world and the next. When someone asks you for dua, write their name down so you remember. See when duas are accepted, how to make dua properly, dua for family and dua for parents.
The evidence
Quran, Surah Al-Hashr 59:10
وَٱلَّذِينَ جَآءُو مِنۢ بَعْدِهِمْ يَقُولُونَ رَبَّنَا ٱغْفِرْ لَنَا وَلِإِخْوَٰنِنَا ٱلَّذِينَ سَبَقُونَا بِٱلْإِيمَٰنِ وَلَا تَجْعَلْ فِى قُلُوبِنَا غِلًّۭا لِّلَّذِينَ ءَامَنُوا۟ رَبَّنَآ إِنَّكَ رَءُوفٌۭ رَّحِيمٌ ﴿١٠﴾
And [there is a share for] those who came after them, saying, "Our Lord, forgive us and our brothers who preceded us in faith and put not in our hearts [any] resentment toward those who have believed. Our Lord, indeed You are Kind and Merciful."
Believers pray for each other.
Quran, Surah Ibrahim 14:41
رَبَّنَا ٱغْفِرْ لِى وَلِوَٰلِدَىَّ وَلِلْمُؤْمِنِينَ يَوْمَ يَقُومُ ٱلْحِسَابُ ﴿٤١﴾
Our Lord, forgive me and my parents and the believers the Day the account is established."
Ibrahim prayed for his parents and all believers.
Sahih Muslim 2732
Sahih... دعوة المرء المسلم لأخيه بظهر الغيب مستجابة ...
"The dua of a Muslim for his brother in his absence is answered."
Dua for others is especially accepted.
Sahih Muslim 2732
Sahih... قال الملك الموكل به آمين ولك بمثل ...
"The appointed angel says: Ameen, and for you the same."
The one who prays for others receives the same.
Sahih al-Bukhari 6397
Sahih... اللهم اهد دوسا وأت بهم ...
"O Allah, guide the tribe of Daws and bring them."
Praying for non-Muslims to be guided is sunnah.
Where the ruling is recorded
- al-Adhkar (al-Nawawi), Chapter on dua for others in their absence. Collects the hadith on praying for others and its virtue.
- Sharh al-Aqida al-Tahawiyya, Section on what benefits the dead. The consensus of Ahl al-Sunnah that dua of the living benefits believers.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.