قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : " مَنْ يُولَدُ يُولَدُ عَلَى هَذِهِ الْفِطْرَةِ، فَأَبَوَاهُ يُهَوِّدَانِهِ وَيُنَصِّرَانِهِ، كَمَا تُنْتِجُونَ الْبَهِيمَةَ، هَلْ تَجِدُونَ فِيهَا مِنْ جَدْعَاءَ حَتَّى تَكُونُوا أَنْتُمْ تَجْدَعُونَهَا ؟ قَالُوا : يَا رَسُولَ اللَّهِ، أَفَرَأَيْتَ مَنْ يَمُوتُ وَهُوَ صَغِيرٌ ؟ قَالَ : اللَّهُ أَعْلَمُ بِمَا كَانُوا عَامِلِينَ "
And the Messenger of Allah, peace and blessings be upon him, said: "Every child is born upon the fitrah (the upright religion), then his parents make him a Jew or a Christian. Just as among your cattle, a young one is born—do you find any among them with a cut ear? Rather, you yourselves cut its ear." The noble Companions, may Allah be pleased with them, asked: O Messenger of Allah! Tell us about the children who die in childhood. The Messenger of Allah, peace and blessings be upon him, said: "Allah knows best what they would have done."
Related hadith on this topic