The dua of Namaz e Janaza is an important part of Muslim funerals. Depending on the age and gender of the deceased Muslim, there are three types of duas for Namaz Janaza.
What is Namaz e Janaza?
The Islamic funeral prayer is called Namaz e Janaza. It is an important part of the Islamic funeral ceremony. The congregational prayer is intended to request forgiveness for the deceased and all Muslims who have died. Salat al-Janazah is a shared duty among Muslims (fard al-kifaya), which indicates that the load is lifted if specific Muslims take on the responsibility. The Muslims will then be held responsible if no one complies.
When the body is not present, the Hanafi and Maliki madhhabs forbid prayer, whereas the Hanbali and Shafi’i madhhabs allow it and recommend it.
Method to offer Namaz e Janaza
Those praying should create odd ranks, with one person standing alone in front and facing the qiblah as an imam. The body is presented to the Imam. If there are many bodies, one should be placed in front of the other.
The spoken section of the prayer begins with a silent recitation of Sura Al-Fatiha, then a prayer to God to bestow justice, grace, and blessings on Muhammad (SAW), and two duas. There is no Ruku in the Janazah prayer.
According to Muhammad (SAW) and his companions, the salat should be conducted as follows:
Raise your hands and read the first Takbir with the right neeyat (intention) in your heart. You fold your hands in front of you, your right hand on the left, and seek refuge with Allah from the wretched Shaytan, saying Bismillah and reciting Al-Fatiha.
After that, you read Takbeer and Durood-i Ibrahimi.
The third Takbir is recited, followed by a dua for the dead (see below).
After a brief pause, a fourth Takbir is read, followed by the last taslim to one side, stating “Assalamu ‘Alaikum Warahmatullah” (“Peace and gifts of God be unto you”).

Dua for Namaz e Janaza of mature dead person
اللَّهُمَّ اغْفِرْ لِحَيِّنَا وَمَيِّتِنَا وَشَاهِدِنَا وَغَائِبِنَا وَصَغِيرِنَا وَكَبِيرِنَا وَذَكَرِنَا وَأُنْثَانَا اللَّهُمَّ مَنْ أَحْيَيْتَهُ مِنَّا فَأَحْيِهِ عَلَى الإِسْلاَمِ وَمَنْ تَوَفَّيْتَهُ مِنَّا فَتَوَفَّهُ عَلَى الإِيمَانِ اللَّهُمَّ لاَ تَحْرِمْنَا أَجْرَهُ وَلاَ تُضِلَّنَا بَعْدَهُ .اللَّهُمَّ صَلِّ عَلَيْهِ وَاغْفِرْ لَهُ وَارْحَمْهُ وَعَافِهِ وَاعْفُ عَنْهُ وَاغْسِلْهُ بِمَاءٍ وَثَلْجٍ وَبَرَدٍ وَنَقِّهِ مِنَ الذُّنُوبِ وَالْخَطَايَا كَمَا يُنَقَّى الثَّوْبُ الأَبْيَضُ مِنَ الدَّنَسِ وَأَبْدِلْهُ بِدَارِهِ دَارًا خَيْرًا مِنْ دَارِهِ وَأَهْلاً خَيْرًا مِنْ أَهْلِهِ وَقِهِ فِتْنَةَ الْقَبْرِ وَعَذَابَ النَّارِ.
English Translation
“O Allah, forgive our existence and our deceased, those who are present among us and those who are lost, our junior and our aged, our males and females,” O Allah, Keep alive in Islam whoever you keep alive from among us, and whoever You kill, kill him in faith., O Allah, pardon him, show leniency toward him; keep him free from all harm; excuse him; regard his rest; make his way simpler; give him water, snow, and hail, and purge him of transgression as a white piece of clothing is purified of soil. O Allah, Give him a house that is superior to his home and a family that is superior to his family.
You can use different expressions in dua; for example, if he was a respectable performer, highlight his great deeds, and if he was a criminal, disregard his evil acts.
Dua for Namaz e Janaza of the male child
اللَّهُمَّ اجْعَلْهُ فَرَطًا وَذُخْرًا لِوَالِدَيْهِ وَشَفِيعًا مُجَابًا ،اللَّهُمَّ ثَقِّلْ بِهِ مَوَازِينَهُمَا ، وَأَعْظِمْ بِهِ أُجُورَهُمَا ، وَأَلْـحِقْـهُ بِصَالِـحِ الْمُؤْمِنِينَ ، وَاجْعَلْهُ فِي كَفَالَةِ إِبْرَاهِيمَ ، وَقِهِ بِرَحْمَتِكَ عَذَابَ الْجَحِيمِ
English Translation
Gracious God, Make him (this youngster) a beginning of profit and fortune for us, and make him a pleader for us and one whose pleading is recognized.
Dua for Namaz e Janaza of the female child
اللَّهُمَّ اجْعَلْهَا فَرَطًا وَذُخْرًا لِوَالِدَيْهَا وَشَفِيعَةً مُجَابَةً ،اللَّهُمَّ ثَقِّلْ بِهَا مَوَازِينَهُمَا ، وَأَعْظِمْ بِهَا أُجُورَهُمَا ، وَأَلْـحِقْـهَا بِصَالِـحِ الْمُؤْمِنِينَ ، وَاجْعَلْهَا فِي كَفَالَةِ إِبْرَاهِيمَ ، وَقِهَا بِرَحْمَتِكَ عَذَابَ الْجَحِيمِ
English Translation
Gracious God, Make her (this youngster) a beginning of profit and fortune for us, and make her a pleader for us and one whose pleading is recognized.
Exceptions to the rule
An authentic hadith says that Muhammad (SAW) did not say the funeral prayers for a suicide victim:
Jabir b. Samura, an individual who had committed suicide with a wide-headed bolt, was brought before the Prophet of Allah. However, he didn’t offer prayer for him. Another exception is for someone who hasn’t paid off loans until they’ve been paid on behalf of a dead individual.