Is It Haram to Talk to Non-Mahram Online?
Question

Well a year from now one of my friends, a girl, had introduced me to one of her online brothers. We have been talking online for about a year now. It’s not like we have ever talked about anything indecent, we talk in a well-respected manner, and he sometimes jokes around too. 

We both are aware of our religion and we know how it is haram to have girlfriends or boyfriends. But over time we both have grown interested in each other. He has told me that he wants to marry me, but right now is too soon, i m only 16 and will be 17 in 2 months... the situation is too hard to explain...and i am really confused on what should be done..and what shouldn’t. I really don’t want to do anything that is Haram or isn't right.. and i do have faith in Allah..that if he is good for me one day we will be together... So i just needed some advice on this.. is talking to a non-mahram guy online wrong?.. And this is the only way we know each other which is through internet...we haven't met..but we have seen each other's pictures.. Well i hope all this makes sense to you..and you will be able to help me out here, cause right now i really need it.. i have been looking through ur site and trying to learn more about our religion..and it is mashallah a good source.. but me still confused..about this situation... we haven't done anything wrong..just talk online.. and hoping that Allah will guide us to be together... but the question that keeps coming up in my mind is if Islamicaly is all this acceptable.. I have talked to other ppl..and he has talked to people too..and some say it's wrong...and some say it's ok as long as our niyyat is good and we haven't done anything wrong.
please give me some advice here..thank you.. khuda hafiz
Praise be to Allah.Applying the principle of warding off harm
It is known in the religion of Allah that it is forbidden to follow in the footsteps of the Shaytan. Everything that could lead a person to fall into haram things is also haram, even if in principle it is originally permitted. This is what the scholars call the principle of warding off harm.
Importance of consulting knowledgeable people
Concerning this matter, Allah says (interpretation of the meaning):
“O you who believe! Follow not the footsteps of Shaytan.” [al-Nur 24:21]
With regard to the second matter, He says (interpretation of the meaning):
“And insult not those whom they (disbelievers) worship besides Allah, lest they insult Allah wrongfully without knowledge.” [al-An'am 6:108]
Here Allah forbids the believers to insult the non-Muslims lest that leads to them insulting the Lord, may He be glorified and exalted.
There are many examples of this principle in the Shari`ah. Ibn al-Qayyim (may Allah have mercy on him) mentioned many of them and explained them well in his excellent book A’lam al-Muwaqqi’in. (See 3/147-171 thereof).
Man-woman interaction in Islam
The issue of talking to the opposite sex here also comes under this category. Conversation, whether verbally or in writing, between men and women is permissible in and of itself, but it may be a way of falling into the traps of the Shaytaan.
Whoever knows that he is somewhat weak, and is afraid that he may fall into the traps of the Shaytan, has to refrain from such conversations , in order to save himself.
Conditions of online chats between men and women in Islam 
Whoever is sure that he will be able to remain steadfast, then we think that it is permissible in his case, but there are certain conditions:

The conversation should not be allowed to wander too far from the topic being discussed; or it should be for the purposes of calling others to Islam .
They should not let their voices be soft, or use soft and gentle expressions.
They should not ask about personal matters that have no bearing on the matter being discussed, such as how old a person is, how tall he or she is, or where he or she lives etc.
Other brothers (in the case of men) or sisters (in the case of women) should take part in the conversation or read the correspondence, so that the Shaytan will find no way to enter the hearts of the people who are conversing or corresponding .
The conversation or correspondence must be halted immediately if the heart starts to stir with feelings of desire.

And Allah knows best.