Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum length of a valid email address?

What is the maximum length of a valid email address? Is it defined by any standard?

like image 383
volatilevoid Avatar asked Dec 22 '08 13:12

volatilevoid


People also ask

How long should a email address be?

So over the last few months, the average email address we saw was 21.9 characters long. If you want your form to accommodate 80% of the email addresses, you need to display 28 characters. And if you want 95% of your web visitors to be able to see what they typed, you need to show at least 31 characters.

What is the maximum length of an Gmail address?

Choose a username 6–30 characters long. Your username can be any combination of letters, numbers, or symbols.

How long should an email address field be?

Most people believe it to be 320 characters (64 characters for the username + 255 characters for the domain + 1 character for the @ symbol). Other sources suggest 129 (64 + 1 + 64) or 384 (128+1+255, assuming the username doubles in length in the future).

How many characters is a valid email address?

The format of email addresses is local-part@domain where the local-part may be up to 64 characters long and the domain name may have a maximum of 253 characters - but the maximum 256 characters length of a forward or reverse path restricts the entire email address to be no more than 254 characters.


1 Answers

An email address must not exceed 254 characters.

This was accepted by the IETF following submitted erratum. A full diagnosis of any given address is available online. The original version of RFC 3696 described 320 as the maximum length, but John Klensin subsequently accepted an incorrect value, since a Path is defined as

Path = "<" [ A-d-l ":" ] Mailbox ">" 

So the Mailbox element (i.e., the email address) has angle brackets around it to form a Path, which a maximum length of 254 characters to restrict the Path length to 256 characters or fewer.

The maximum length specified in RFC 5321 states:

The maximum total length of a reverse-path or forward-path is 256 characters.

RFC 3696 was corrected here.

People should be aware of the errata against RFC 3696 in particular. Three of the canonical examples are in fact invalid addresses.

I've collated a couple hundred test addresses, which you can find at http://www.dominicsayers.com/isemail

like image 164
7 revs, 3 users 74% Avatar answered Sep 20 '22 14:09

7 revs, 3 users 74%