Email address normalize
email-address-normalize · version 1.0.0 · Communications · free, no key needed
Validate one email addr-spec and return its canonical form: minimal quoting, NFC local-part, lowercase domain.
Use when you need to: normalize an email address · canonical form of an email address · lowercase the domain of an email address.
Decide before calling
Read the versioned contract and the supported scope below. Reuse email-address-normalize@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use email-address-normalize@1.0.0 for normalize an email address. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- normalize an email address
- canonical form of an email address
- lowercase the domain of an email address
- remove unnecessary quotes from an email local part
- are these two email addresses the same mailbox
- validate email address syntax strictly
- נרמול כתובת אימייל
Not supported
- lowercase the local-part or strip dots and +tags (provider-specific, not standard)
- convert internationalized domains between U-labels and A-labels (IDNA)
- parse "Name <addr>" display-name forms, comments or domain literals
- check deliverability with DNS, MX or SMTP
Behavior
- Accepts exactly one addr-spec: a dot-atom or RFC 5321 Quoted-string local-part (no FWS, no HTAB), "@", and a domain of at least two ASCII LDH labels; non-ASCII local-part characters must be Unicode letters, marks or numbers (RFC 6531 3.3 subset).
- The quoted form is decoded (each quoted-pair stands for its character, RFC 5322 3.2.1), NFC-normalized (RFC 6532 3.1), then written with minimum quoting (RFC 5321 4.1.2): unquoted when it is valid dot-atom text, otherwise quoted with only "\" and DQUOTE escaped.
- Local-part case is preserved (RFC 5321 2.4: local-parts are case sensitive); the domain is ASCII-lowercased (domains are not case sensitive). No provider-specific rules are applied.
- Limits: local-part at most 64 octets (as written and as normalized), labels at most 63, address at most 254 (RFC 5321 4.5.3.1); the top-level label must not be all-numeric (RFC 3696 2).
- invalid_input (details.reason) for syntax errors; unsupported_input for well-formed features outside the subset: comments or surrounding white space, display names, domain literals, single-label or U-label domains, obsolete local-parts, non-letter non-ASCII characters.
- requires_smtputf8 is true when the normalized address contains non-ASCII characters (RFC 6531). changed is true when the normalized address differs from the input. Unicode classes and NFC come from the runtime Unicode version.
- An address longer than 254 UTF-8 bytes is limit_exceeded, checked before parsing.
Input
address(string, required): min length 1; One addr-spec, at most 254 UTF-8 bytes, no surrounding white space.
Output
address(string, required): min length 5; max length 254local_part(string, required): min length 1; max length 64domain(string, required): min length 3; max length 252local_part_form(one of "dot-atom", "quoted-string", required)requires_smtputf8(boolean, required)changed(boolean, required)
Limits
- max address bytes: 254
Example
Request input:
{
"address": "\"john.q.public\"@Example.COM"
}
Response:
{
"result": {
"address": "john.q.public@example.com",
"local_part": "john.q.public",
"domain": "example.com",
"local_part_form": "dot-atom",
"requires_smtputf8": false,
"changed": true
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "email-address-normalize",
"version": "1.0.0",
"input": {
"address": "\"john.q.public\"@Example.COM"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/email-address-normalize/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"address":"\"john.q.public\"@Example.COM"}'
The machine-readable contract is at /v1/tools/email-address-normalize/versions/1.0.0.
CLI
node cli.mjs run email-address-normalize 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Email address list deduplicate: Drop duplicate mailboxes in an RFC 5322 address-list, keeping the first one.
- Email address list validate: Check RFC 5322 address-list syntax, including dots, quotes, comments, and groups.
- Email address list parse: Parse an RFC 5322 address-list into ordered mailboxes, groups, and a canonical form.
- Email mailbox format: Render a canonical RFC 5322 mailbox from decoded parts, without a delivery claim.
- Email address list format: Format mailboxes and groups as one deterministic RFC 5322 address-list.
- Email mailbox parse: Parse one RFC 5322 mailbox into parts and canonical text, without a delivery claim.