HomeArticlesHow ToValidate Email Addresses
HOW TO

How to Validate Email Addresses

Learn how to validate email addresses — checking format, MX records, disposable domains, and role-based prefixes. Includes regex and free online validator.

Reviewed by the thecalcu.com team · Last updated August 4, 2026

Free calculators used in this guide

Email Validator

Sending email to an invalid or undeliverable address is one of the most avoidable causes of poor deliverability, high bounce rates, and eventual blacklisting. Validation isn't one check. It's a layered process covering format, domain infrastructure, and address hygiene. This guide walks through each layer in order, explains the reasoning behind it, and shows what to do (and what to skip) at each step.

Overview

Email validation verifies that an address is correctly formatted, points to a domain with working mail infrastructure, and isn't a known throwaway or role-based address. Doing this before an address lands in any system, registration forms, contact capture, checkout flows, protects your sender reputation and makes sure your messages actually reach people.

A fully validated address has passed four tests: syntax format (RFC compliance), domain existence (DNS lookup), mail server existence (MX record), and address hygiene (not disposable, not role-based). The Email Validator tool on this site runs all four automatically.

What You Need

  • The email address to validate
  • A sense of which validation layers apply to your case (a simple form? a marketing list? a transactional system?)
  • For programmatic validation: a regex library and DNS resolution access, or a third-party validation API
  • For bulk list cleaning: a CSV of addresses and a batch validator

Step 1: Check Email Format

The first check is purely syntactic. Does the address conform to the structure defined in RFC 5321 and RFC 5322?

A valid email address has exactly one @ symbol separating a local part and a domain:

local-part@domain.tld

Local part rules (before the @):

  • Maximum 64 characters
  • Valid characters: letters (a-z, A-Z), digits (0-9), and the special characters ., +, -, _, %
  • Can't start or end with a dot
  • Can't contain two consecutive dots

Domain rules (after the @):

  • Maximum 255 characters (domain + TLD)
  • Must contain at least one dot
  • Labels (parts between dots) can contain letters, digits, and hyphens
  • Labels can't start or end with a hyphen
  • TLD must be at least 2 characters (.io, .com, .museum)

Overall length: the complete address must not exceed 254 characters.

Here's a practical regex that covers the common valid cases without trying to be RFC-complete, which would be unreadably complex:

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

It correctly accepts user+tag@domain.co.uk and firstname.lastname@company.org while rejecting @nodomain, nodomain@, and two@@atsigns.

What format checking won't catch: a syntactically valid address like test@fakedomainthatdoesnotexist.com passes this check but bounces on delivery. Format checking is only the first step.

Step 2: Validate the Domain and MX Records

Format validation confirms the address is structured correctly. DNS validation tells you whether the domain actually exists and can receive mail.

Two DNS lookups matter here:

  1. A/CNAME record lookup confirms the domain resolves to a server. nslookup example.com or dig example.com A should return an IP address.

  2. MX record lookup confirms the domain has a designated mail server. nslookup -type=MX example.com or dig example.com MX should return one or more mail exchanger records with priority values.

If the domain has no MX record, mail sent to any address on it bounces with a "550 No MX record" error or similar. A domain can run a website perfectly well without any email infrastructure behind it, which is common for placeholder domains, parked domains, and single-page sites.

Here's what an MX lookup returns for a valid domain:

example.com    MX preference = 10, mail exchanger = mail1.example.com
example.com    MX preference = 20, mail exchanger = mail2.example.com

And what a missing MX record looks like:

*** No MX records found for thisdomain.example

No MX records means the domain can't receive email, so don't add it to your list.

The Email Validator runs this DNS lookup automatically, so you don't need to run dig commands by hand for individual addresses.

Step 3: Check for Disposable Email Domains

Disposable email addresses are temporary inboxes. They accept messages for a short window, minutes to hours, then expire. People create them specifically to avoid handing out a real address.

Some well-known disposable providers:

  • mailinator.com
  • tempmail.com and temp-mail.org
  • guerrillamail.com
  • yopmail.com
  • 10minutemail.com
  • throwam.com

Over 3,000 known disposable providers exist, and new ones show up regularly. Detection means checking the submitted address's domain against a continuously updated blocklist.

Why it matters: a user who signs up with a disposable address never intended to be contacted. Their "inbox" expires before your welcome email even lands. Adding them to a list inflates your subscriber count, produces hard bounces, and skews your campaign analytics.

What to do with disposable addresses: reject them at sign-up with a clear message ("Please use a permanent email address"), log the attempt for fraud pattern analysis, and don't silently accept then bounce later. That wastes send credits and hurts your sender score.

Step 4: Check for Role-Based Prefixes

Role-based email addresses are tied to a job function, not a person. Common examples:

Prefix Why it's problematic
admin@ Often shared; high complaint rate
info@ Monitored by multiple staff or an auto-responder
support@ Ticketing system; unsubscribes often missed
sales@ CRM routing; personal emails preferred for consent
noreply@ Can't receive replies; consent unclear
postmaster@ Technical role; not a marketing contact
abuse@ Used specifically to report spam

Role-based addresses aren't invalid. They follow RFC format and often have working MX records. But they carry more risk for marketing and transactional email: they aren't tied to one consenting individual, which raises GDPR and CAN-SPAM issues, shared inboxes mean spam reports can come from staff who never signed up, and many ESPs score these addresses negatively or reject them at import.

The practical approach is to flag role-based addresses rather than silently accept them. For B2B lead capture, you might accept info@ and sales@ while blocking noreply@ and abuse@. For consumer sign-up forms, reject all of them.

Step 5: Never Validate by Sending a Test Email

A common misconception holds that the most reliable way to validate an address is to send a test message and watch for a bounce. This runs into real problems.

SMTP probing is largely blocked now. Connecting to a mail server's SMTP port and running the handshake (RCPT TO:<address>) without sending a real message used to work for validation. Today, major providers like Google, Microsoft, and Yahoo return a 250 OK to any address to stop directory harvesting, which makes the check useless. Others reject the probe outright and flag your IP as suspicious.

Catch-all domains accept everything. Many corporate domains configure their mail server to accept all addresses at @company.com and route them to a central inbox or discard them. A bounce test against these domains always returns success, even for addresses that don't exist.

There's a cost too: probe messages, even without a body, generate SMTP activity from your IP. Repeated probing gets your IP or domain flagged by spam filters, which hurts deliverability for your legitimate sends.

The better approach: use MX record validation (Step 2) plus a double opt-in confirmation email. The confirmation email sent to the address is the only reliable end-to-end test, and it doubles as your consent record.

Common Mistakes to Avoid

Accepting typo domains. user@gmail.con, user@hotmial.com, and user@yahooo.com all pass format validation but bounce. Fuzzy matching for common provider typos, suggesting the corrected domain instead of silently accepting the mistyped one, catches a surprising number of these.

Not checking MX records. Format validation alone lets through addresses on non-email domains. Add the DNS MX lookup step for any system where deliverability matters.

Overly strict regex blocking valid addresses. Plus addressing (user+tag@domain.com) is valid under RFC 5321, and so are hyphens in the local part and TLDs longer than 3 characters (.museum, .photography). A custom regex that's too narrow will reject legitimate addresses, so test yours against a corpus of known-valid edge cases before shipping it.

Not normalising before storage. Lowercase the domain part at minimum before saving to a database. RFC 5321 treats the domain as case-insensitive, so User@Domain.COM and user@domain.com are the same address, and storing them unnormalised causes duplicate accounts and failed login lookups.

Treating validation as one-time. Addresses valid at sign-up can go stale later: people change jobs, domains expire, providers shut down. Regular list hygiene, removing addresses that hard-bounce or haven't opened anything in 12+ months, matters as much as validation at the point of capture.

Formula & Methodology

Email validation follows a layered model, where each layer catches a class of invalid addresses the previous layer misses:

Layer 1: Syntax (regex)
  Catches: malformed addresses, missing @, invalid characters
  Misses: valid format but non-existent domains

Layer 2: DNS / MX Lookup
  Catches: domains with no mail infrastructure
  Misses: valid domains with catch-all servers

Layer 3: Blocklist (disposable + role-based)
  Catches: throwaway providers, functional role addresses
  Misses: newly created disposable providers

Layer 4: Double Opt-In
  Catches: everything else, non-existent local parts, catch-all domains
  Cannot be bypassed

The regex pattern follows RFC 5321 section 4.1.2 (local-part) and RFC 5322 section 3.4.1 (addr-spec). A simplified but production-suitable version:

^[a-zA-Z0-9._%+\-]{1,64}@[a-zA-Z0-9.\-]{1,255}\.[a-zA-Z]{2,}$

For MX validation, the DNS query type is MX (type 15 in the DNS protocol). At least one MX record with a valid priority integer and mail exchanger hostname is enough for this layer to pass.

Double opt-in remains the definitive validation method. It proves the address is real, accessible, and controlled by whoever submitted it. Every other layer is a pre-filter that improves list quality before that confirmation email goes out.

The Email Validator runs all four layers on any address in one pass.

Frequently Asked Questions

What is the maximum length of a valid email address?
RFC 5321 caps the total length of an email address at 254 characters. The local part (before the @) can run up to 64 characters, and the domain (after the @) up to 255. In practice, most providers enforce shorter limits: Gmail local parts max out at 30 characters, for example. Validating against the 254-character overall limit catches edge cases that shorter UI limits may miss.
Does a valid email format guarantee the address exists?
No. Passing a regex check means the format is syntactically correct, nothing more. An address like test@thisdomain-does-not-exist-at-all.com passes format validation but will hard-bounce the moment you send to it. Real deliverability confirmation needs an MX record lookup at the DNS level and, ideally, a double opt-in from the recipient.
What are role-based email addresses and why should I flag them?
Role-based addresses are tied to a function rather than a person: admin@, info@, support@, sales@, noreply@, postmaster@, abuse@, and similar prefixes. These are typically monitored by several people or automated systems, and they generate spam complaints and bounces far more often when added to a marketing list. Most ESPs like Mailchimp and SendGrid flag or reject them automatically at list import, so filtering them at capture protects your sender reputation.
Is user+tag@domain.com a valid email address?
Yes, it is. The plus sign is a valid character in the local part under RFC 5321. This is called subaddressing or plus addressing, and Gmail, Fastmail, Protonmail, and many others support it. user+newsletter@gmail.com and user@gmail.com deliver to the same inbox, so a regex that rejects the plus sign will block perfectly valid addresses, which is a common mistake in custom validation code.
What is an MX record and why does it matter for email validation?
An MX record is a DNS entry that names the mail server responsible for receiving email on a domain. Without one, the domain simply cannot receive mail, and any message sent there bounces. Checking MX records during validation catches addresses on domains that are registered but never set up for email, something format checking alone can't see. It costs a network call, but it cuts your hard-bounce rate significantly.
What is a disposable email domain and how do I detect one?
Disposable domains hand out temporary inboxes that expire after minutes or hours, and mailinator.com, tempmail.com, guerrillamail.com, yopmail.com, and 10minutemail.com are among the better-known ones. Over 3,000 such providers exist. Detection means checking the domain against a blocklist that services like the [Email Validator](/email-validator/) maintain and update, and blocking these at sign-up cuts fake registrations and keeps your list clean.
What regex pattern should I use for basic email validation?
A production-safe basic pattern is `/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/`. It allows letters, numbers, dots, percent, plus, hyphens, and underscores in the local part, a domain with dots and hyphens, and a TLD of at least two characters. Fully RFC 5322-compliant patterns exist too, but they run to hundreds of characters and rarely earn their keep in production. Pair this simpler regex with MX validation and you'll cover most real cases.
Can I validate emails by sending a test message to the address?
You can try, but it's a bad idea. SMTP probing, connecting to the mail server and running the handshake without actually sending, is now widely blocked, since most major servers return a fake 250 OK to prevent directory harvesting. Even where it works, catch-all domains accept any address regardless of whether it exists, and repeated probing can get your sending IP flagged as suspicious. Use DNS MX lookup plus format validation instead, and save actual delivery for the double opt-in email.
What is the difference between syntax validation and semantic validation for email?
Syntax validation checks that the email follows the RFC format rules: correct characters, proper placement of the @, valid domain structure. Semantic validation asks whether the address is actually useful, checking MX records, known providers, disposable status, and role-based prefixes. Production systems need both layers. Syntax checks alone give a false sense of security, and semantic checks without syntax checks first tend to produce inconsistent results.
Should I validate emails on the client side or server side?
Both, for different reasons. Client-side validation in the browser catches typos immediately and smooths out the user experience, but it can be bypassed with dev tools or a direct API call, so it's never the final word. Server-side validation is mandatory, and for anything where email quality matters, like e-commerce, SaaS, or newsletters, add server-side MX lookup and disposable-domain checking too.
What is double opt-in and why is it the gold standard for email validation?
Double opt-in sends a confirmation email to a newly registered address and requires the user to click a link before the account activates. It's the only method that confirms the address exists, is accessible, and belongs to the person who signed up. It cuts fake sign-ups by more than 90%, lowers bounce and complaint rates substantially, and satisfies GDPR and CAN-SPAM consent requirements, which is why most serious email programs default to it for new list acquisition.
What happens if I don't validate emails before adding them to a mailing list?
You'll see hard bounces from addresses that don't exist and spam complaints from role-based or purchased ones. A hard-bounce rate above 2% or a complaint rate above 0.1% triggers warnings or suspensions from ESPs like Mailchimp, SendGrid, and Amazon SES. Keep that up and your sender domain and IP end up blacklisted, meaning even your legitimate emails stop landing in inboxes. Rebuilding a contaminated list's reputation can take 3 to 6 months.

Related Articles

BEST OF

Best Free Online Validators for Developers 2026

HOW TO

How to Validate OpenAPI / Swagger Specs

GUIDE

Data Format Validators: IPs, MAC Addresses, ISBNs & More

HOW TO

How to Format JSON Data

HOW TO

How to Generate a UUID