Article

Client-Side vs Server-Side Email Validation: What Each Layer Can and Cannot Check

By Unlimited Verifier Team ·

Diagram showing client-side email validation in the browser feeding into server-side email validation and an optional verification service.

Summary

Client-side email validation checks format in the browser for instant feedback, while server-side validation re-checks format and adds DNS and MX lookups that browsers cannot run. Neither can prove a mailbox exists, so reliable setups use both layers plus bulk verification on existing lists.

Client-side email validation checks an address's format in the visitor's browser before a form is submitted. Server-side validation re-checks that format on your own backend and adds network checks, such as DNS and MX lookups, that a browser cannot run. Neither layer can prove a mailbox exists, so reliable setups use both and run bulk verification on lists they already hold.

Quick answer

What is the difference between client-side and server-side email validation?

Client-side validation runs in the browser and can only judge what the browser knows. Server-side validation runs after submission on infrastructure you control, so it can query DNS and enforce rules the user cannot switch off. The difference matters less for format than for trust: the browser runs on the user's machine, so its verdict is advisory.

Client-side (browser) Server-side (your code) Bulk or API verification (dedicated service)
Where it runs Visitor's browser Your application server Third-party service, via file upload or API
Syntax check Yes, using the browser's email grammar Yes, re-run with the same rules Yes
Domain and MX lookup No, browsers cannot make DNS queries Yes, through your resolver Yes
SMTP mailbox probe No, browsers cannot open raw SMTP connections Possible, but outbound port 25 is often restricted Yes, usually rate-controlled
Catch-all detection No Limited; needs probing and careful interpretation Yes, flagged in results
Can a user bypass it? Yes, by disabling scripts or posting directly to your endpoint No, if enforced on the server Not applicable; you control the list
Latency Immediate Fast for cached DNS; SMTP probes can take seconds Depends on file size and queue
Best job Typo feedback while typing Rules that must hold on every write Cleaning existing lists

The most common mistake is treating the first column as protection. It is a usability feature. The second and third columns decide what enters your database.

Bottom line: Client-side validation improves the form; server-side and bulk validation decide what gets stored.

What can client-side email validation check, and where does it break?

Client-side validation enforces the browser's built-in email grammar plus any pattern you add. It is instant and free, which makes it the right place for typo feedback, but it cannot confirm that a domain receives mail. The WHATWG HTML specification defines the validity rule for type="email", and it is looser than most developers expect: a value such as user@localhost is valid because the domain part does not need a dot. MDN's reference for the email input type shows how browsers apply it.

A minimal implementation:

<label for="email">Work email</label>
<input id="email" name="email" type="email" required maxlength="254" autocomplete="email">
const input = document.querySelector('#email');

input.addEventListener('blur', () => {
  input.setCustomValidity(''); // clear the previous message
  if (!input.checkValidity()) {
    input.setCustomValidity('Enter an address like name@company.com');
  }
  input.reportValidity();
});

Where it breaks:

Should you write your own regex? Rarely. A custom pattern is hard to keep correct, and each extra rule is another way to reject a real customer. Use the browser's grammar on the client, apply the same grammar plus a length limit on the server, and let routing and mailbox checks do the rest. For framework-specific patterns, see JavaScript email validation and React Hook Form validation.

Bottom line: The browser can tell you an address is shaped correctly. It cannot tell you whether anyone can receive mail there.

What can server-side validation check that the browser can't?

Server-side validation can query DNS for mail routing, check curated lists of disposable and role-based domains, and, with caveats, probe the receiving mail server. Each of those signals is invisible to the browser.

Syntax. RFC 5322 defines what an address may contain, including quoted local parts and comments that most providers refuse. Its grammar is too permissive to use as a filter. The practical rule is to validate what you are willing to store, and apply that rule identically on the client and the server.

Routing (MX, then A/AAAA). Mail is delivered to the hosts in a domain's MX records. RFC 5321, section 5.1 adds a fallback: if no MX record exists, the sender uses the domain's address record. A check that rejects every domain without MX therefore refuses some domains that can receive mail. If you use Laravel, its built-in dns rule performs a similar check; see Laravel's DNS validation rule.

This Node.js function returns one of three states, not a boolean:

import { promises as dns } from 'node:dns';

const withTimeout = (promise, ms = 2000) =>
  Promise.race([
    promise,
    new Promise((_, reject) =>
      setTimeout(() => reject(Object.assign(new Error('timeout'), { code: 'ETIMEOUT' })), ms)
    ),
  ]);

const isDefinitive = (err) => err.code === 'ENODATA' || err.code === 'ENOTFOUND';

// Returns 'routable', 'unroutable' or 'unknown'
async function checkRouting(domain) {
  try {
    const mx = await withTimeout(dns.resolveMx(domain));
    if (mx.length > 0) return 'routable';
  } catch (err) {
    if (!isDefinitive(err)) return 'unknown';
  }
  // RFC 5321 implicit MX: fall back to the A record
  try {
    await withTimeout(dns.resolve4(domain));
    return 'routable';
  } catch (err) {
    return isDefinitive(err) ? 'unroutable' : 'unknown';
  }
}

The sample checks IPv4 only. A production version should also try resolve6 for AAAA-only domains before returning unroutable. Our suggested 2-second timeout is a starting point; tune it to your resolver. The key design choice is that only a definitive "no such record" answer rejects a signup. A timeout means "unknown," and unknown should never block a real customer.

Mailbox probing (SMTP). An SMTP check connects to the receiving server, issues RCPT TO for the address, reads the reply, and disconnects before DATA, so no message body is delivered. Under RFC 5321, reply codes starting with 2 mean accepted, 4 means temporary failure, and 5 means permanent failure. The full exchange is walked through in how an SMTP email check works.

Running this yourself has real constraints. Many major cloud providers restrict outbound port 25 by default, and policies change. Receiving servers rate-limit and greylist unfamiliar senders, and some high-volume mailbox providers decline to confirm individual mailboxes at all. Probing at scale from one IP can get that IP blocklisted. Most teams therefore buy a dedicated email verification API and automation service instead of building a prober.

Approach What you control Main cost Main risk
Browser grammar only Form behaviour None Accepts dead domains such as gmial.com
Your own DNS and SMTP prober Every check and retry rule Engineering time and IP reputation work Port 25 restrictions; blocklisting at volume
Self-hosted open-source engine Reading and modifying the logic Servers and maintenance Inherits the same port 25 and IP issues
Hosted verification service Inputs, thresholds and how results are used Subscription or per-check fees Third-party data processing; needs a privacy notice

Unlimited Verifier's engine is open source on GitHub at github.com/unlimitedverifier/free-email-verifier, so you can read how its checks are implemented before choosing between hosted and self-hosted.

Bottom line: The server can check routing and mailbox signals the browser cannot, but SMTP results need interpretation, not just storage.

Why does an SMTP check sometimes give the wrong answer?

An SMTP check fails in four predictable ways, so treat its result as one of three states: valid, invalid or unknown.

Unlimited Verifier sorts results into Valid, Risky and Invalid. The Risky bucket exists for exactly these uncertain cases, and it is where a reviewer should look first when a list behaves oddly. For catch-all specifics, see the catch-all email verification page.

Signal What it usually means Recommended action
Syntax fails Cannot be a deliverable address Reject at the form
No MX and no A/AAAA record Domain does not receive mail Reject
Permanent 5xx on RCPT TO Mailbox rejected Reject or suppress
Catch-all domain Server accepts everything Accept and flag; send only with confirmed opt-in
Temporary 4xx or timeout Unknown Retry later (a delay of around 15 minutes is a reasonable starting point); do not reject
Disposable or role address Low-value or non-personal Accept with a flag; exclude from marketing if policy requires

Bottom line: Store the category and the reason, not just a boolean "valid," so you can act on uncertainty correctly later.

Which validation layer should you use for each job?

Use the browser for typing feedback, the server for rules every write must pass, and bulk or API verification for anything that could damage your sender reputation. The right mix depends on what a bad address costs you.

Job Layers to use Why
Newsletter signup Client + server syntax + routing High volume, low friction; catches typos and dead domains without blocking real users
SaaS account creation Client + server + asynchronous mailbox check A bad address blocks password resets and billing emails
Checkout and order confirmation Client + server syntax Transactional mail must arrive; flag Risky results rather than blocking them
Partner or CRM import Bulk verification before upload You control the file and can clean it in one pass
Outbound sales lists Bulk verification + role and disposable flags Cold outreach is where bounces and spam-trap risk concentrate
Quarterly list hygiene Bulk verification + list maintenance Lists decay as people change jobs

For the bulk and API rows, Unlimited Verifier fits with these specifics:

Its limits matter too. There are no native ESP, CRM or Zapier integrations, so you export, verify and re-import, or call the API from your own code. On Free, results are kept for 24 hours; on Pro, for 30 days. For B2B prospecting, see email verification for sales prospecting. Ecommerce and software signups follow the same pattern under email verification for ecommerce and SaaS.

Bottom line: Match the layer to the cost of a bad address, not to what is easiest to build.

What is the best layered validation process?

A layered process catches each class of error at the cheapest point that can detect it. Follow these six steps in order.

  1. Decide what each form does with each result. Write a one-line policy per form: reject, accept and flag, or accept silently. Most teams skip this and end up blocking real users.
  2. Share one rule set between client and server. Keep the pattern and length limit in a shared module. Divergent rules cause "why did the browser accept it and the server reject it?" tickets. Use 254 characters as the maximum length: RFC 5321 limits the forward path to 256 octets including angle brackets, so 254 is the commonly used practical limit. Some references cite 320 characters as a theoretical maximum. For form validation, use 254.
  3. Run routing checks on the server with timeouts. Check MX, then A/AAAA, and turn timeouts into "unknown."
  4. Run mailbox checks asynchronously for new accounts. Keep SMTP or API calls out of the request path. Our guide to webhook vs polling for bulk verification covers how to receive results later.
  5. Store the category, reason and timestamp. A record of "Risky: catch-all, checked 2025-03-02" lets you re-verify later instead of trusting stale data.
  6. Re-verify existing lists on every import and on a schedule. Monthly for active B2B lists and quarterly for consumer lists is a common cadence; adjust it to your bounce data.

Bottom line: Each layer should do only the job it suits, and every result should be stored so it can be re-checked.

How do you set up client and server validation step by step?

This tutorial has two paths. If you don't write code, do steps 7 and 8 only.

  1. Mark up the input. Use type="email", required, maxlength="254" and autocomplete="email".
  2. Add feedback on blur. Use the JavaScript above, calling checkValidity() and reportValidity(). Avoid validating on every keystroke, which flags users who type slowly.
  3. Re-check on the server with the same rule. Reject empty values, values over 254 characters, and anything that fails the shared pattern. Never trust the client result.
  4. Add the routing check. Use the checkRouting function above. Reject only on unroutable; store unknown and move on.
  5. Call a verification API for high-value forms. Keep the API key in a server-side environment variable, never in browser code. Generate keys on the Email verification API page. API access requires the Pro plan, so sign up and choose Pro before wiring this step in.
  6. Test with known addresses. Use the free single-email checker to compare a handful of results against what your server returns.
  7. Export your existing list. Save your contacts as a CSV with the email column and any engagement fields, such as last open or signup date.
  8. Clean the list. Upload and verify the list. Files up to 10MB are accepted, and the email column is detected automatically. Download results as CSV, Excel or JSON before the Free plan's 24-hour retention window closes.
  9. Re-import only what you intend to use. Import Valid contacts to your email platform, suppress Invalid addresses, and set a written policy for Risky ones. Because there is no native integration, this is a manual import or an API script.

Bottom line: Build the form layer first, then add the server rule, then clean what you already have.

What does layered validation cost in practice?

The two examples below use hypothetical volumes. The plan limits and arithmetic are real.

Example A: a SaaS signup form

Assume 12,000 signup submissions a month reach the server after client-side checks.

The lesson: the economics depend on how much of the allowance you use, not on the headline per-check rate. For how plans compare, see email verification pricing.

Example B: a 60,000-row legacy list

Assume a 60,000-row list imported from an old CRM. Pro handles lists of up to 25,000 each and includes 25,000 deep verifications a month.

Bottom line: At realistic volumes, the decision is about quota planning. Splitting files and prioritising deep checks matter more than headline prices.

What mistakes do teams make with email validation?

Bottom line: Most failures come from enforcing rules in the wrong place or treating an uncertain result as a definite one.

How we compared (and limitations)

This article is based on public documentation: the WHATWG HTML specification, MDN's email input reference, RFC 5321, RFC 5322, and Google's email sender guidelines. We have not benchmarked verification accuracy across providers.

Unlimited Verifier's 99.5% accuracy figure for deep verification is the company's own stated number, not an independent benchmark. Port 25 policies vary by cloud provider and change over time, so check your host's current rules. The code samples are illustrative and have not been run in your environment; check them against your runtime version. The volumes in the worked examples are hypothetical, while the plan limits and arithmetic reflect the stated plan terms.

For the broader layer model this article builds on, start with real-time email validation. For tool comparisons, see our tool roundup.

Layered validation setup

  1. Browser: run type="email" and a matching pattern for instant typo feedback.
  2. Server: apply the same rules on every write and reject malformed input.
  3. Server DNS: check MX, then A/AAAA, with a short timeout; reject clear failures.
  4. Async verification: for new high-value accounts, queue an SMTP check and store the result.
  5. Bulk: verify imported lists before sending; route results into Valid, Risky, and Invalid buckets.
Result Action
Valid Send normally
Risky (catch-all, timeout) Send with caution or sample first
Invalid Remove or require correction

Frequently asked questions

Is client-side email validation enough on its own?

No. Client-side validation is easy to bypass by disabling JavaScript or posting directly to your endpoint. It is useful for instant typo feedback, but you should always re-validate the same rules on the server before storing an address.

Can JavaScript check whether an email address exists?

No. Browsers cannot perform DNS queries or open SMTP connections to a mail server, so JavaScript can only check the address format. Confirming that a mailbox exists requires server-side or third-party verification.

What is the difference between syntax validation and deliverability validation?

Syntax validation checks whether the address follows the allowed format, such as a local part, an @ sign, and a domain. Deliverability validation goes further by checking DNS records, MX records, and sometimes mailbox existence through an SMTP check.

Should I check MX records or A records?

Check MX records first. If a domain has no MX record, many mail systems fall back to the A or AAAA record for delivery, so a missing MX alone does not always mean mail cannot be received. Apply a timeout and treat failures as a signal, not a certainty.

Why does SMTP verification sometimes give wrong results?

Some mail servers accept every address (catch-all), some block verification probes, and some greylist unknown senders. These behaviors can produce false valid or false invalid results, so ambiguous outcomes should be labeled Risky rather than Valid.

Does server-side validation slow down sign-up forms?

Format checks and cached DNS lookups are fast. SMTP probes can take several seconds, so run them asynchronously for new accounts and avoid blocking the user's request while waiting for a mailbox response.

Should I block sign-ups from disposable email domains?

It depends on your risk model. Many teams flag or block known disposable domains for free-trial or promo forms, while allowing them elsewhere. Maintain the list as a policy decision rather than assuming any single list is complete.

How often should I re-verify an email list?

Re-verify when you import a new list, before large campaigns, and periodically for inactive contacts. Addresses decay over time as people change employers or abandon accounts, so older data should not be trusted without checking.

Cut Bounces and Protect Your Sender Reputation With Unlimited Email Verification

Every invalid address you send to hurts your sender reputation and your inbox placement. Verifying your list before each send means fewer bounces, healthier deliverability, and a predictable cost. With Unlimited Verifier, standard verification is unlimited on every plan, with no per-email fees.

Unlimited Verifier checks syntax, domain, MX records and the SMTP mailbox. It also detects catch-all domains and flags disposable and role-based addresses. Export a CSV from your email platform or CRM, upload and verify the list, then re-import the clean results. You can also automate checks with the email verification API.

Free Pro
Price $0 $29/month ($25/month billed annually)
Lists 25 a month, up to 150 emails each Unlimited, up to 25,000 emails each
Deep verifications 750 a month 25,000 a month
API access No Yes (100,000 emails a month)
Result retention 24 hours 30 days

Why teams choose Unlimited Verifier

Unlimited Verifier states 99.5% accuracy for deep verification.

Create a free account and verify your next list before you hit send.

Want to test a single address first? Try the free email checker.