Your first 100,000 email verifications or 10,000 work emails found are on us.100K verifications or 10K finds, free.Sign up today

HomeGuidesJavaScript email validation

JavaScript email validation: check in the browser, confirm on the backend

Use input type=\"email\" and a short JavaScript check in the browser to catch a missing @ or a stray space. That only checks the format. To know the inbox exists, call a verify API from your backend. The code below does both with the built-in fetch.

Free while in beta. No card needed.

Key takeaways

  • The browser check catches format mistakes, like a missing @ or a space.
  • It can't tell if the inbox exists. jane@gmial.com passes a format check.
  • Confirm the address on your backend with one verify call, and keep your API key there.

Updated 2 Dec 2026

What can JavaScript email validation check?

A browser check can only look at how the text is written. It can tell that jane.acme.com has no @, but it can't tell if jane@acme.com is a real inbox. Add type="email" to the input and the browser checks the format for you when the form is submitted. Then add a short JavaScript check of your own for a better message.

<form id="signup" action="/signup" method="post">
  <input type="email" id="email" name="email" required autocomplete="email" />
  <button type="submit">Sign up</button>
  <p id="msg" role="alert"></p>
</form>
// Format only: one @, something on each side, a dot in the domain, no spaces.
function looksLikeEmail(value) {
  const email = value.trim();
  const parts = email.split("@");
  if (parts.length !== 2 || email.includes(" ")) return false;
  const [name, domain] = parts;
  return (
    name.length > 0 &&
    domain.includes(".") &&
    !domain.startsWith(".") &&
    !domain.endsWith(".")
  );
}

Keep this check loose. A strict rule will turn away real addresses, and a loose one still catches the common slips.

How do you confirm the inbox exists?

Send the address from your backend to the verify endpoint and read the verified field. It's true only when the mailbox is confirmed. Call the API from your backend, never from the browser, so your key stays private.

Create a key under API keys in the dashboard and save it as EFV_API_KEY. See create and manage API keys. This example uses Express on Node 18 or newer. Run npm install express first.

// server.mjs
import express from "express";

const BASE = "https://api.emailfinderverifier.com/api/v1";

async function verifyEmail(email) {
  const url = new URL(BASE + "/verify");
  url.searchParams.set("email", email);
  const res = await fetch(url, {
    headers: { "X-API-Key": process.env.EFV_API_KEY },
    signal: AbortSignal.timeout(60000),
  });
  if (!res.ok) throw new Error("Verify call failed: " + res.status);
  const data = await res.json(); // { verified: true, esp: "Outlook" }
  return data.verified === true;
}

const app = express();
app.use(express.json());

app.post("/check-email", async (req, res) => {
  const email = String(req.body.email || "").trim();
  if (!email.includes("@")) return res.status(400).json({ verified: false });
  try {
    res.json({ verified: await verifyEmail(email) });
  } catch (err) {
    console.error(err.message);
    res.json({ verified: null }); // the check failed: don't block the signup
  }
});

app.listen(3000);

New accounts can send 1 request per second, which suits a signup form. For a whole list, upload a CSV instead. See limits and common errors.

How do you wire the two together?

Run the format check first, then call your backend, then decide. Add this to the browser script.

const form = document.getElementById("signup");
const input = document.getElementById("email");
const msg = document.getElementById("msg");
let askedOnce = false;

input.addEventListener("input", () => {
  askedOnce = false;
  msg.textContent = "";
});

form.addEventListener("submit", async (event) => {
  event.preventDefault();
  if (!looksLikeEmail(input.value)) {
    msg.textContent = "Enter an address like name@company.com";
    return;
  }
  const res = await fetch("/check-email", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ email: input.value.trim() }),
  });
  const data = await res.json();
  if (data.verified === false && !askedOnce) {
    askedOnce = true;
    msg.textContent = "We couldn't confirm that address. Check the spelling, or press Sign up again to continue.";
    return;
  }
  form.submit();
});

The form asks once, then lets the person through. A real address can come back false, such as a catch-all one, so don't hard-block. See verify website signups.

Get your API key and run the backend check. Free while in beta.

Sign up for free

What if you also need to find an email?

Call /find with first_name, last_name and domain. You get an email, or null when none was found. A found email still needs /verify before you use it. See Find and verify emails from Node.js for a full script with retries.

01FAQ

JavaScript email validation: FAQ

01Is input type="email" enough to validate an email?

No. It checks the format only. jane@gmial.com passes, and so does an address that doesn't exist.

02Should I use a regular expression to validate emails?

You don't need one. A short check for one @ and a dot in the domain is enough in the browser. Anything stricter risks turning away real people.

03Can I call the verify API from the browser?

Don't. Your API key would be visible to anyone. Call it from your backend.

04What does verified: false mean?

We couldn't confirm the mailbox. The address may be wrong, or it may be real but not confirmable, so ask the person to check it instead of blocking them. See what verification results mean.

05Does this work in React or Vue?

Yes. The format check and the fetch call to your backend work the same way in any framework.

06What does it cost?

Email Finder Verifier is free while in beta.

07Start today

Get your API key in a minute

Sign up with email or Google. No card. Your key and a ready-made first request are waiting. Need more later? Message us on Slack.