Parse email address

Parse common RFC 5322 mailbox forms into display name, local part, and domain.

freeworks offlinenothing uploaded
ToolEmail Address Parser
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Mailbox text is separated only at delimiters outside quoted strings and angle-bracket address parts, then common name-address forms are split into display name and addr-spec fields. A conservative dot-atom check reports ordinary addresses without pretending to implement every obsolete RFC grammar.

  • Quoted and angle-bracket sections are protected while separating multiple mailboxes.

Worked example

Multiple email formats
Parse named, quoted, and parenthesized email address formats
Input
											Jane Doe <[email protected]>
"Support Team" <[email protected]>
[email protected] (Site Admin)
										
Output
												Original                              Name          Email                 Local     Domain       Valid
------------------------------------  ------------  --------------------  --------  -----------  -----
Jane Doe <[email protected]>       Jane Doe      [email protected]  jane.doe  example.com  yes
"Support Team" <[email protected]>  Support Team  [email protected]   support   example.com  yes
[email protected] (Site Admin)        Site Admin    [email protected]     admin     example.com  yes
											

When to use this

Address-book imports, From-header display, and contact migrations parse mailboxes.

Edge cases

  • A quoted display name containing a comma stays one mailbox.
  • Angle brackets protect separators inside the address.
  • Comments and obsolete grammar are reported conservatively.

References