New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
SMTP and APIUpdated 26 Oct 2026

Maximum Email Address Length: Local Part, Domain and Total Limits (64, 63 and 254)

The real limits on email address length: 64 characters for the local part, 63 per domain label, 254 in total, how databases and forms should handle them, and why a short address is better anyway.

TK
Written by Tomasz Kowalski
Infrastructure and Reliability Engineer
Reviewed by Mateus Oliveira
  • Published23 Nov 2024
  • Read time6 min
  • Length1,219 words
Share this guide

How long can an email address be? The question sounds trivial until a signup fails for one customer with a long corporate address, or a database silently truncates an address and mail goes to the wrong person. The standards set clear limits, but they are spread across several documents and are often misquoted. A single number worth remembering is 254, and it is not the one found in the first place most people look.

This article lays out the limits for each part of an address, explains where they come from, shows how to size database columns and form fields, and describes what goes wrong when you get them wrong.

Local partUp to 64 octets (the part before the @)
Domain labelUp to 63 octets for each dot-separated label
Total addressUp to 254 characters in practice (the standard path limit of 256 includes angle brackets)
Practical adviceAllow 254 characters in storage, validate all three limits and do not truncate silently

The limits at a glance

ElementLimitSource and notes
Local part (before @)64 octetsSet in the SMTP specification
Domain name as text253 characters (255 octets in wire format)DNS limit on a full name
Each domain label (between dots)63 octetsDNS limit
Complete forward path in SMTP (including angle brackets)256 octetsSMTP limit for the path in RCPT TO and MAIL FROM
Complete email address254 characters256 minus the two angle brackets; the figure confirmed in later errata and widely used
Number of recipients per messageAt least 100 must be accepted by serversServers may accept more or enforce lower limits. See too many recipients
Header line998 characters maximum, 78 recommendedApplies to the whole header. See SMTP line length

The numbers refer to octets, not visible characters. For ASCII text the two are equal. With international characters in an address, one visible character can take several octets, which means the effective limit in characters is lower.

Where the 254 figure comes from

The SMTP specification says the maximum total length of a reverse-path or forward-path is 256 octets, including the punctuation (the angle brackets) that surrounds an address in the commands. Removing those two characters leaves 254 for the address itself. Older documents and some libraries quote 255 or 320, the latter by adding 64 + 1 + 255. That sum is a theoretical combination of the two parts and is not a valid length, because the whole path is capped lower. Treat 254 as the practical maximum.

A worked example

local part: a-very-long-mailbox-name@               (up to 64 characters)
domain:     division.department.example-company.com (labels up to 63 each)

Full address must be: 254 characters or fewer.
Example check:
  len(local) <= 64
  every label in domain <= 63
  len(domain) <= 253
  len(local) + 1 + len(domain) <= 254

What real addresses look like

Most real addresses are short, often under thirty characters. Long ones usually come from one of a few sources: automatically generated mailbox names for system accounts, plus-addressed tags that include order or campaign identifiers, department-based addresses at large institutions, and test data created by developers or security tools. Treat unusually long input with care. It can be legitimate, but it can also be an attempt to overflow a field, probe validation or generate junk.

How to size database columns

ChoiceRecommendation
Column typeVARCHAR(254) is sufficient for the address; some teams use 255 to leave a margin
Character setUse a Unicode-capable set so international addresses are stored correctly
IndexIndex the normalised comparison column. A unique index on a long string is fine at 254 characters, but watch key-length limits in your engine
Separate fieldsStore the address as one value; do not split local part and domain unless you need domain statistics
Display nameStore separately and with a larger field (for example 255 or more)
Primary keysDo not use the address as a primary key; use a surrogate id so the address can change
CREATE TABLE contacts (
  id          BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  email       VARCHAR(254) NOT NULL,
  email_norm  VARCHAR(254) AS (LOWER(email)) STORED,
  created_at  DATETIME NOT NULL,
  UNIQUE KEY uq_contacts_email_norm (email_norm)
) DEFAULT CHARSET=utf8mb4;

With a multibyte character set, some older MySQL index configurations limit the indexed length in bytes, so test your schema with maximum-length data. See case handling for related normalisation choices.

Validation rules for forms and APIs

  1. Trim first, then measure.
  2. Reject empty input and addresses without exactly one separating @ (the local part can contain a quoted @ only in rare cases; most public forms can reject it).
  3. Check the local part is 1 to 64 octets.
  4. Check each domain label is 1 to 63 octets and that the whole domain is at most 253 characters.
  5. Check the total is at most 254.
  6. Use a field maxlength of 254 in the browser as a convenience, and enforce the limit on the server as the real control.
  7. Return a clear error that says what is wrong without exposing internals.
  8. Never truncate to fit a field; reject instead. A truncated address is a different, possibly real, address.
function validEmailLength(string $e): bool {
    if (strlen($e) > 254) return false;
    $parts = explode('@', $e);
    if (count($parts) !== 2) return false;
    [$local, $domain] = $parts;
    if ($local === '' || strlen($local) > 64) return false;
    if ($domain === '' || strlen($domain) > 253) return false;
    foreach (explode('.', $domain) as $label) {
        if ($label === '' || strlen($label) > 63) return false;
    }
    return true;
}

What goes wrong when the limit is ignored

FailureCauseImpact
Silent truncationField narrower than the address (for example VARCHAR(50))Mail goes to a different, possibly real person; privacy incident
Signup rejectedOverly strict client-side length checkLost customers with legitimately long addresses
Receiving server rejectionAddress longer than the server acceptsBounce with a syntax or recipient error. See 501 and 503 errors
Index errors on importKey length exceeded for the engineImport aborts midway
Log or report truncationNarrow columns in analyticsMatching events to contacts fails
Injection attemptsVery long or malformed input used to probe a formMitigate with strict validation. See header injection

Why shorter is better

Even though 254 characters are allowed, shorter addresses are more reliable. They are easier to type on a phone, less likely to wrap in a template, simpler to read aloud and less likely to be mistyped. For your own senders, choose a clear, short mailbox name on a short domain, for example [email protected] instead of a long department path. See choosing the domain name for guidance.

Testing checklist

  1. Test addresses at exactly 64 characters in the local part and one more.
  2. Test a domain label at 63 characters and one more.
  3. Test a total of 254 and 255 characters.
  4. Test an address with multibyte characters and check storage and display.
  5. Confirm that rejected input is not stored anywhere.
  6. Check that log and report tables accept the full width.
  7. Send a message to a maximum-length address in a controlled environment and confirm the envelope is intact.

The length rules are simple once you separate the three layers: 64 for the local part, 63 for each domain label and 254 for the whole address. Size your storage for 254, validate all three limits on the server, reject rather than truncate, and remember that a shorter address is easier for everyone.

Validate addresses at the door Check syntax, length and domain automatically.

Open the email validator

References and further reading

Frequently asked questions

What is the maximum length of an email address?

254 characters in total, with at most 64 octets in the local part and 63 octets in each domain label.

Why 254 and not 256?

The SMTP path limit is 256 octets including the angle brackets around the address, which leaves 254 for the address itself.

How long should my database column be?

VARCHAR(254), or 255 if you prefer a margin, in a Unicode-capable character set.

Should I truncate long addresses?

No. Reject them, because a truncated address may be a different valid address.

Are long email addresses common?

No. Most addresses are short. Very long ones are usually system-generated, plus-tagged or test data.

Topics#email addresses#limits#validation#database#rfc 5321
Was this guide helpful?Your answer helps us improve our documentation.

Start sending in minutes.

Create an account, add your domain and send your first email.

Get started Talk to sales