What Makes a Good Email Validation Regex?
There's a spectrum from too permissive (accepts a@b) to too strict (rejects valid addresses like user+tag@company.co.uk). The right choice depends on your use case — user registration, marketing import, or API validation all have different requirements.
Simple vs RFC 5322: Which Should You Use?
The simple regex ^[^s@]+@[^s@]+.[^s@]+$ catches 99% of real invalid emails with near-zero false positives. The full RFC 5322 regex is 6,000+ characters and technically allows user@[192.168.1.1] — valid by the standard, but not by practical standards. Use simple unless you have a specific reason not to.
Why regex101.com and regexr.com Don't Work for This
regex101.com and regexr.com are great for testing a regex against a single string. They don't support bulk testing against a list. If you have a CSV of 500 email addresses and need to know which ones your validation logic would reject, you need a different tool — which is exactly what this does.
Common Email Patterns That Trip Up Validators
Email addresses that are technically valid but commonly rejected by sloppy regex: user+tag@gmail.com (plus sign), user.name@company.co.uk (multiple dots in domain), user@company.io (short TLD), 123@numeric.org (numeric local part), u@a.co (very short local part and domain).
Frequently Asked Questions
What is the best regex for email validation in JavaScript?
For most use cases: /^[^\s@]+@[^\s@]+\.[^\s@]+$/ — simple, no false positives on real emails. For stricter validation: /^[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])?)*$/ (simplified RFC 5322).
Does user+tag@gmail.com pass email validation?
It should. The plus sign (+) is a valid character in the local part of an email address (RFC 5321). Many basic regexes incorrectly reject it. Our "Basic Email" preset handles it correctly.
How do I test my email regex against 500 addresses?
Paste your regex in the pattern field, then paste all 500 emails in the list field (one per line). Click Process to see a table showing which pass and which fail, plus a summary count.
Why does HTML5 type="email" accept some addresses my server-side code rejects?
HTML5 uses its own simplified email pattern that differs from RFC 5322 and from common server-side libraries. Always validate email server-side separately from the browser — the browser constraint is UX, not security.