Entering Islam requires two things: belief in the heart and verbal declaration.
An-Nawawī, in his commentary on Ṣaḥīḥ Muslim, said: “The consensus among Ahl al-Sunnah (the people of the Sunnah) from the scholars of Ḥadīth, jurisprudence, and theology is that a believer, who is considered part of the community of the Qiblah (the direction Muslims face during prayer) and will not be eternally in the Fire, must believe with a firm conviction in the religion of Islam without any doubts and must pronounce the two Shahādahs (the declaration of faith). If he only does one of these, he is not considered part of the Qiblah community at all unless he is unable to speak.”
Based on this, intention alone is not sufficient to grant a person the legal rulings of Islam, such as marriage, funeral prayer if he dies, and inheritance rights.
Public testimony (Shahādah) is not a requirement for the validity of conversion to Islam from a religious perspective. However, it might be needed legally for matters of marriage, divorce, inheritance, financial transactions, and so on, to prevent false claims.
Fatwā issued by Dr. Khālid Naṣr