Free tool
Email regex tester
Test an email regex against a list of addresses, start from a recommended pattern, and see what each one accepts. A regex only checks the shape of an address: it can't tell whether the domain takes mail or whether the inbox is a throwaway.
7 of 15 match · 15 of 15 known cases as expected
- Matches: ana@example.complain address
- Matches: ana.lima+promo@gmail.comdots and a +tag are valid
- Matches: o'brien@example.ieapostrophes are allowed
- Matches: user@mail.example.co.uksubdomains and two-part suffixes
- Matches: user@xn--bcher-kva.exampleinternationalized domain (punycode)
- No match: ana..lima@example.comtwo dots in a row
- No match: .ana@example.comlocal part starts with a dot
- No match: ana@exampleno top-level domain
- No match: ana@-example.comlabel starts with a hyphen
- No match: ana@example.cone-letter top-level domain
- No match: ana lima@example.comunquoted space
- No match: ana@@example.comtwo @ signs
- No match: "ana lima"@example.comvalid in RFC 5322, never handed out
- Matches: qwe@mailinator.comvalid syntax, but disposable
- Matches: jane@gmial.comvalid syntax, but a typo of gmail.com
Valid syntax isn't a real inbox. Check every sign-up with one API call. Free for 7 days or 1,000 checks, no card.
Start free trialThe recommended pattern, explained
The recommended pattern reads in three parts:
- Local part (before the
@): letters, digits and the symbols RFC 5322 allows (such as+,',!,#and=), in dot-separated runs. No leading, trailing or double dots. Quoted local parts like"john doe"@example.comare valid under RFC 5322 but almost never real, so they're left out. - Domain labels: 1 to 63 letters, digits or hyphens, not starting or ending with a hyphen, each followed by a dot.
- Top-level domain: 2 to 63 letters, or an internationalized
xn--label. This rejectsuser@localhostanduser@example.c.
What no regex can check
A pattern that matches perfectly still accepts qwe@mailinator.com (a disposable inbox), ana@gmial.com (a typo of a real provider), and ana@no-such-domain-4821.com (a domain with no mail servers). All three pass every regex on this page.
Checking those takes data and DNS: a list of disposable domains, the domain's MX records, and a typo check against common providers. That's what the disposable email checker and the AntiBurner API do after the syntax check. More in Email regex: why validation regex isn't enough.
Length limits
Keep length checks outside the regex, where they're readable: at most 64 characters before the @ and at most 254 for the whole address (the limit that fits an SMTP path). Trim surrounding spaces before you validate, and lowercase the domain before you compare it with anything.
Copy the recommended email regex
The same pattern in JavaScript, with the length limits checked outside the regex. It needs no lookbehind, so it also works in most other regex engines.
const EMAIL = /^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+(?:[a-z]{2,63}|xn--[a-z0-9-]{1,59})$/i;
export function looksLikeEmail(input: string): boolean {
const email = input.trim();
const at = email.lastIndexOf("@");
if (at < 1 || at > 64 || email.length > 254) return false;
return EMAIL.test(email);
}The HTML spec pattern is what browsers use for an input with type="email". It allows consecutive dots in the local part and a domain without a dot, which is why the tester shows it accepting a few addresses no provider hands out.
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/Questions
What is the best regex for email validation?
One that accepts every address people really use and rejects obvious mistakes: a dot-atom local part, domain labels of letters, digits and hyphens, and a real-looking top-level domain. The recommended pattern on this page does that. Then check the domain with DNS, because no regex knows whether it receives mail.
What regex does the HTML email input use?
The HTML standard defines input type="email" with a pattern that allows the usual local-part characters and LDH domain labels, but doesn't require a dot in the domain, so user@localhost passes. It's included in the tester as the HTML spec pattern.
Can a regex validate every RFC 5322 email address?
Technically close, but the result is thousands of characters long and accepts addresses no mail provider hands out, such as quoted strings with spaces or comments. Practical validation deliberately accepts a smaller, real-world subset.
Does a regex check if an email address exists?
No. A regex only checks the format. Whether the domain receives mail needs a DNS lookup, whether it's a throwaway needs a disposable-domain list, and whether the mailbox exists can only be confirmed by sending a verification email.
More free tools
Disposable email checker
Is this address a throwaway? A live verdict from the AntiBurner engine.
Open toolMX lookup
A domain's mail servers and priorities, with burner mail infrastructure flagged.
Open toolFree email providers list
Gmail, Outlook, Yahoo, Proton, iCloud and more, plus a live check for any domain.
Open tool
Related guides
- Guide5 min read
Email regex: why validation regex isn't enough
A practical email validation regex, what each part does, the RFC rules it skips on purpose, and the checks a regex can't do: deliverability, burners and typos.
- Guide6 min read
How to check if an email address is disposable
Five ways to tell if an email address is disposable, from a domain list to MX records and domain age, what each one misses, and how to combine them at sign-up.
Valid syntax isn't a real user.
One call tells you if the domain takes mail or is a throwaway.
- 7-day free trial
- 1,000 checks included
- No card
- Then from $9 a month