Everyday takeaways
- An email field has four settings that matter at launch, and each one acts at a different moment: in the markup you ship, while the visitor types, or after they submit.
- The browser's format check, switched on with type="email", tests whether the text has the shape of an address. It cannot tell you whether the mailbox exists or belongs to the visitor.
- Length caps are often copied from sample code, so a cap chosen without reference to the standards can turn away addresses the standard allows.
- Show a format error after the visitor leaves the field, and clear it as soon as the value is fixed.
- Say at the field what the address will be used for, so the visitor is not surprised by the first message.
- Confirming ownership is the only setting that shows a mailbox works, and every confirmation method adds friction at signup.
An email field setting is any rule that decides which addresses a box accepts, when it complains about one, or what happens to the address after submit. TL;DR: ship the format and length rules in the markup, and show errors after the visitor leaves the field. State the address's use at the field, and choose a confirmation method before launch.
The decision an email box makes at launch
Each submission puts the email box through three decisions: whether the text may enter the form, whether the visitor hears about a problem and when, and whether the address is trusted enough to create an account. A common shortcut is to copy a sample value for the first decision. Yet the MDN reference for the email input uses sample values for width and length that are examples rather than rules. The other two decisions are rarely written down, so they drift between the design file and the code.
The four settings in this post follow that split. The first two settings live in the markup you ship. The third governs when an error appears while the visitor types. The fourth governs what happens after submit, including the confirmation step and the notice about messages. The glance table lines them up by launch moment.
The four settings at a glance
The glance table names each setting by the moment it acts and the failure it prevents. The sources sit in the sections that follow, beginning with the MDN email input reference for the first setting.
| Setting | Launch moment | Failure it prevents | Who it fits |
|---|---|---|---|
| One. Format rule (type="email") | Markup, before launch | Text that cannot be an address reaches your server | Any form with an address box |
| Two. Length bounds (minlength, maxlength) | Markup, before launch | Input that is too long or too short for the field's storage, rejected with no clear reason | Forms that write to a column with a fixed size |
| Three. Error timing | While the visitor types | Errors shown before the visitor finishes, or no error at all | Forms where errors are common |
| Four. Ownership and notice | After submit | An account nobody can reach, or messages nobody expected | Accounts that must receive mail |
If you are unsure who this is for
This post is for growth leads who decide what the email box on a signup form accepts, usually with an engineer and a designer in the room. The settings are ranked by what they decide for the account, not by how much they cost to build.
Skip this if the form never creates an account. Warning signs: the only validation is in the browser, which the MDN reference says is not enough on its own for anything with security implications, or nobody on the team owns the messages the form triggers.
Setting one: Let the browser check the shape of the address
Set type="email" on each address box before launch. According to MDN Web Docs, browsers apply a format rule that "ensures that the value of the field is properly formatted to be an email address", and a site must "verify the email address on the server side" for anything with security implications.
The check's weak point is that a correctly shaped address can still be misspelled or made up, so the format rule cannot confirm that a mailbox exists. It fits any form with one address box, because the setting costs one attribute. It does not fit as the only check on a value that reaches your database or your mail system.
Setting it takes three steps. Add type="email" to the field, and keep a server-side check that runs on the same value. Write your own message beside the field so the visitor sees what to fix instead of the browser's default wording.
Setting two: Set length bounds from the standards, not the sample
According to MDN Web Docs, the sample box is 32 character-wide, with a minimum of 3 characters and a maximum of 64 characters, and a second sample allows up to a maximum of 256 characters.
The sample values are examples, and the page presents them as examples. The standard for the address itself is the email address standard.
Two cautions follow. MDN counts length in UTF-16 code units, so a cap can misfire once an address uses non-ASCII letters. Second, a cap on the front end is not a cap on storage, so the server must enforce whatever limit the team takes from the linked standard.
Setting the bounds fits forms that write to a column of fixed size. Its weak point is that a cap below the standard turns away addresses the standard allows. Likewise, a minimum set higher than the visitor's input causes failures on short but valid addresses. Setting it takes two steps: write the limits from the linked standard into your field specification, then set maxlength and minlength to values the server also enforces.
Setting three: Decide when a format error appears
Timing is the setting visitors feel first.
Timing fits any form where the Setting one rule can fire, which is every form with an address box. Its weak point is that timing does not fix a wrong address; it only changes when the visitor hears about the problem. Setting it takes three steps: check the field when the visitor leaves it, clear the message as soon as the value becomes valid, and log which fields keep firing so their wording can be rewritten.
Setting four: Confirm the mailbox and say what it is for
The notice belongs at the field itself. According to GOV.UK, the rule is to "Make it clear to users when you collect any details that you may use them for sending messages", and transactional messages need no prior permission.
Double entry is the cheapest typo check, but it does not confirm the mailbox. According to University of Waterloo, a second box cuts typos, but it "can't eliminate them entirely" because some people paste the address.
Double opt-in sends a confirmation message and waits for a click. The table compares the three ways to treat the address after submit on the same criteria.
| Criterion | Format rule only | Double entry | Double opt-in |
|---|---|---|---|
| Shows the mailbox works | No | No | Yes |
| Catches typos | Only text that cannot be an address | Some, not pasted errors | Yes, if the visitor never gets the message the account stays unconfirmed |
| Friction added at signup | One attribute, no extra step | One extra field | A confirmation round trip |
| Main weak point | A misspelled or made-up address still passes | Some people paste the address | Some people never click the message |
| Best fit | Any form with an address box | Trial forms where the account can wait for a fix | Accounts that must receive mail from the first day |
The cost shows up in one dataset. Its newsletter data shows a lower subscription rate for double opt-in, according to the newsletter data. This is newsletter data, not a measure of a signup form's own conversion, so treat it as a guide to where to test, not a forecast for your form.
Double entry fits forms where a second box is acceptable and the account can wait for a fix. Double opt-in fits accounts that must receive mail from the first day. Its weak point is that some people never click the confirmation message. Pick one confirmation method before launch, write the notice on the field, and decide which parts of the account wait for confirmation.
Common mistakes
- Copying the sample values from the MDN reference as if they were the standard's limits.
- Treating type="email" as verification, when the same reference says the server must verify the address.
- Showing a format error while the visitor is still typing.
- Asking for a second address box and assuming the two boxes prove the mailbox works.
- Sending account messages without saying at the field what the address will be used for.
- Setting a length cap on the front end only, with nothing on the server.
Glossary
- Format rule: the browser check that the text matches the standard shape of an address.
- Length cap: a maxlength or minlength setting that limits how many characters the field accepts.
- UTF-16 code unit: the unit MDN uses to count the length of the field's text.
- Octet: a unit of one byte, which the email address standard uses for its size limits.
- Local part: the text before the @ sign in an address.
- Double entry: a second address box that the visitor fills in to match the first.
- Double opt-in: a confirmation message the visitor must act on before the address is used.
- Transactional message: a message the visitor triggers or expects, such as an account notice, as opposed to a subscription message.
Worked example
An illustrative worked example (not a real case): A team with 3 forms puts one address box on each. So it writes the format rule once and applies it to all of them, as Setting one describes. It then takes its outer limit for every box from the linked standard rather than the MDN sample, which is a choice of the team rather than a requirement, and it sets the server to enforce the same number. For the trial form, the team picks double entry instead of a confirmation message, because the second box adds one field and no mail round-trip. For the account form that must receive notices, it keeps double opt-in, and it accepts the cost that the newsletter data reports. The choices are the team's own reading of these sources, and the team should measure its own signup data before it treats them as settled.
Which email field setting should you pick?
- If your form has one address box and no other check, pick Setting one first, because it is the cheapest rule and it stops text that cannot be an address before it reaches your server.
- If your team has a sample length from documentation, pick the length-bounds setting and replace the sample with the limits from the linked standard, because a cap below the standard turns away addresses the standard allows.
- If visitors complain that errors appear while they type, pick Setting three with a check on leave, because the error then appears after the visitor has finished the field.
- If your account must receive password resets and notices, pick double opt-in from the ownership setting, because an address nobody can reach locks the visitor out of the account they just made.
- If your trial must stay short and you want a typo check, pick double entry over double opt-in, because it adds one field instead of a confirmation round trip.
More guides
FAQs
Does type="email" stop fake addresses?
No. It checks the shape of the text, not whether the mailbox exists or belongs to the visitor, so you still need a server-side check.
Should the length cap follow the standard's limits?
Yes, take the limits from the linked email address standard, because the MDN sample values are examples, and enforce them on the server.
Do I need a confirm-email field?
Not by default. A second box adds one more field, and it cannot stop paste errors.
When should the error message show?
Show it after the visitor leaves the field, and clear it as soon as the value becomes valid.
Does double opt-in cost sign-ups?
The newsletter data reviewed here shows a lower subscription rate for double opt-in, so the cost is real in that data. You should still measure your own signup form before you decide.
Do I need a notice if the address only receives account messages?
Yes. State at the field what the address will be used for, because GOV.UK's guidance is to make that clear, even though transactional messages need no prior permission.