Free · Fast · Privacy-first

Regex for Email Validation — Pattern, Explanation, and Live Test

Email validation is one of the most common regex tasks in web development. Below is a practical, production-tested regex pattern for email addresses, with a breakdown of each component — plus a live tester so you can verify it against your own email inputs before using it in your code.

Cost
Free forever
Sign-up
Not required
Processing
In your browser
Privacy
Files stay local

Production-tested email regex pattern provided

🔒

Every part of the pattern explained

Test against real email addresses live

Developer Tool

Regex Tester

All processing happens in your browser — your files are never uploaded to any server.

🚀Open Regex Tester

100% Free · No account · Works on any device

How to use this tool

💡

Load the email validation pattern: ^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$ — then test it against your email inputs to verify it accepts valid addresses and rejects invalid ones.

How It Works

Step-by-step guide to regex for email validation — pattern, explanation, and live test:

  1. 1

    Use the recommended pattern

    Start with: ^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$

  2. 2

    Understand the pattern

    ^[a-zA-Z0-9._%+\-]+ matches the local part (before @). @ matches the literal at sign. [a-zA-Z0-9.\-]+ matches the domain name. \.[a-zA-Z]{2,}$ matches the TLD (2 or more letters, like .com or .co.uk).

  3. 3

    Test with valid inputs

    Test with valid addresses like user@example.com, first.last@company.co.uk, and user+tag@subdomain.domain.org.

  4. 4

    Test with invalid inputs

    Test rejection of: missing @ (userexample.com), missing domain (user@), double dots (user@.com), and spaces (user @example.com).

  5. 5

    Adapt if needed

    For stricter validation, enforce maximum lengths. For lenient validation, allow more special characters in the local part.

Frequently asked questions

5 questions

Ready to get started?

Open the full Regex Tester — free, no account needed, works on any device.

Open Regex Tester

Free · No account needed · Works on any device