75699271 cf18da72a2 s Developers: How long should your email inputs be?An article on reddit brought on the inspiration for this, an actual answer to how long an email input field should be. Many developers say or use 255 characters; for example; <input type=”text” name=”email” maxlength=”255″ /> – this is incorrect!

The maximum length of an email address is made up of three parts, firstly the “local” part with a max of 64 characters, usually a users name or nickname which is infront of the @ sign. Secondly, a 1 character @ sign in the middle, and lastly a domain which can be a maximum of 255 characters.

So to sum it up, bill@microsoft.com would be:

  • Local: “bill”
  • @
  • Domain: “microsoft.com”

135528793 b39b42d5c8 s Developers: How long should your email inputs be?This means the maximum length an email address can be is 64+1+255 or 320 characters. For database designers this has also often been an issue as MySQL limits VARCHAR’s to 255 characters and you don’t want to use a blob/text field – but this is also incorrect! Since MySQL 5.0.3 you can have up to 65,535 characters in a VARCHAR!

 Developers: How long should your email inputs be?

Popularity: 12% [?]

If you enjoyed this post, make sure you subscribe to my RSS feed!