Can I chat online with a girl?
What is the legal ruling regarding chatting with the other sex on the internet and if it is permissible, what are the boundaries of its permissibility?
The mere fact of conversing with the other sex is permissible in Islamic law without any legal impediment which hinders one or the two sexes from talking to each other as long as they keep the legal guidelines and as long as there is no locked door which prevent others from walking into the room in which the man and the woman are conducting the conversation.
This is the established scholarly opinion of authentic scholars and the evidence on their legal stance is extracted from both the Quran and the Sunnah. In the Quran for example God says in the story of Prophet Moses and the two girls, He said, "What is your circumstance?" They said, "We do not water until the shepherds dispatch [their flocks]; and our father is an old man." 28:32
And from the Prophetic traditions, Abu Juhaifa narrated that when the Prophet (peace be upon him) allied in brotherhood between the Immigrants from Makkah (Muhajerin) and the helpers in Medinah (al Ansar) both Salman and Abu al Dardaa became brothers. So one day Sulaiman visited Abu al Dardaa at his home and saw his wife and she was upset so he asked her “what’s wrong?” and she replied “your brother Abu al Dardaa does not have any need for this world” (al Bukhari). Al Hafiz ibn Hajar in his book (Fath al Bari) commented on this hadith and said that we can extract from this hadith the permissibility of conversing with women and posing questions which would bring benefits.
More importantly, not every seclusion is meant to be a prohibited seclusion as Bukhari and Muslim reported through the authority of Anas ibn Malik that a woman from the Ansar came to the Prophet so he sat alone with her and addressed her saying “by God you- the women of Ansar- are dear to my heart” and al Bukhari included this hadith under the chapter titled “Chapter on the permissibility of seclusion between a man and a woman when they are among people”. Al Hafiz ibn Hajar in his book (Fath al Bari) said that conversing with non mahram women secretly does not cause questioning one’s religiosity should there be no temptation. Mulla ‘Ali al Qari in his book “Mirqat al Mafatih” said that seclusion with a woman in the street is not the same as seclusion with a woman in a house. Sheikh al Shabramalsi al Shafi’i opined in his commentary on (Nihayat al Muhataj) that the prohibited private seclusion only occurs when the meeting of the two sexes is accompanied by a strong potential of temptation but if usually there is no room for temptation, seclusion is not prohibited.
Also the Prophet’s wives used to teach male companions about juristic issues and convey God’s religion and the Islamic rulings on different issues. Volumes on the Prophetic traditions are filled with hadith traditions that are reported through the Prophet’s wives and the later generations of female companions and scholars who formed strong circles in the chain of narrating prophetic traditions along with delving into other Islamic sciences. Al Hafiz ibn Hajar al ‘Asqalani recorded in his book (al Isabah fi Tamyiz al Sahaba) the names of 1543 female scholars be it jurists, traditionists and intellectuals. Therefore conversing with the other gender online is permissible as long as the legal guidelines are kept intact.