# 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](/v1/tools/email-address-normalize/versions/1.0.0) 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 254
- `local_part` (string, required): min length 1; max length 64
- `domain` (string, required): min length 3; max length 252
- `local_part_form` (one of "dot-atom", "quoted-string", required)
- `requires_smtputf8` (boolean, required)
- `changed` (boolean, required)

## Limits

- max address bytes: 254

## Example

Request input:

```json
{
  "address": "\"john.q.public\"@Example.COM"
}
```

Response:

```json
{
  "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](/docs#connect)), then call `execute` with:

```json
{
  "id": "email-address-normalize",
  "version": "1.0.0",
  "input": {
    "address": "\"john.q.public\"@Example.COM"
  }
}
```

### HTTP (no key)

```sh
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](/v1/tools/email-address-normalize/versions/1.0.0).

### CLI

```sh
node cli.mjs run email-address-normalize 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Email address list deduplicate](/tools/email-address-list-deduplicate): Drop duplicate mailboxes in an RFC 5322 address-list, keeping the first one.
- [Email address list validate](/tools/email-address-list-validate): Check RFC 5322 address-list syntax, including dots, quotes, comments, and groups.
- [Email address list parse](/tools/email-address-list-parse): Parse an RFC 5322 address-list into ordered mailboxes, groups, and a canonical form.
- [Email mailbox format](/tools/email-mailbox-format): Render a canonical RFC 5322 mailbox from decoded parts, without a delivery claim.
- [Email address list format](/tools/email-address-list-format): Format mailboxes and groups as one deterministic RFC 5322 address-list.
- [Email mailbox parse](/tools/email-mailbox-parse): Parse one RFC 5322 mailbox into parts and canonical text, without a delivery claim.
