Email Validation Done Right

I have a problem.

I have a problem with most email validators on the web. They let through things that are completely wrong. They mark good email addresses as invalid.

I have decided to write my own validators. In fact, I decided to write more than one to make sure that they are right and to have an algorithm that will likely work with my language of choice at the moment.

The Rules

There are so many rules that I broke them out into two pages. I have a human-readable version that explains the rules, and then there is the ABNF form that shows most of the rules in a token-based style.


I have a page that shows many crazy email addresses and the correct results for those email addresses. It also gives you a live evaluation of the different versions of my code, which is primarily there as a means for me to make sure that changes work.

Alternatively, you can try it yourself:

Email: Valid


I am very interested in correcting these algorithms. If you have sample email addresses that are identified incorrectly by these programs, please let me know. However, you should first make sure that the rules from the RFC allow or disallow that email address. I have summarized these rules to make your validation faster.

Stalin's left arm was noticeably shorter than his right. Tyler Akins <>
Legal Info