Need help with mailcheck?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

7.8K Stars 493 Forks MIT License 172 Commits 44 Opened issues


Reduce misspelled email addresses in your web apps.

Services available


Need anything else?

Contributors list


TravisCI Build Status

The Javascript library and jQuery plugin that suggests a right domain when your users misspell it in an email address.

mailcheck.js is part of the Mailcheck family, and we're always on the lookout for more ports and adaptions. Get in touch!

What does it do?

When your user types in "[email protected]", Mailcheck will suggest "[email protected]".

Mailcheck will offer up suggestions for second and top level domains too. For example, when a user types in "[email protected]", "" will be suggested. Similarly, if only the second level domain is misspelled, it will be corrected independently of the top level domain.


See it live in action here.


For instant use, download the minified library mailcheck.min.js into your javascripts directory. mailcheck.js is also available unminimised if you want to hack on it, or have your own minimizer.


> bower install --save mailcheck


> npm install --save mailcheck

Usage with jQuery

First, include jQuery and Mailcheck into the page.

Have a text field.

Now, attach Mailcheck to the text field. You can declare an array of domains, second level domains and top level domains you want to check against.

Mailcheck takes in two callbacks,

. We recommend you supply both.

is called when there's a suggestion. Mailcheck passes in the target element and the suggestion. The suggestion is an object with the following members:
  address: 'test',          // the address; part before the @ sign
  domain: '',    // the suggested domain
  full: '[email protected]'  // the full suggested email

Mailcheck does not want to get in the way of how you can show suggestions. Use the suggestion object to display suggestions in your preferred manner.

is called when there's no suggestion. Mailcheck just passes in the target element. It is a good idea to use this callback to clear an existing suggestion.

Usage without jQuery

Mailcheck is decoupled from jQuery, so its usage without jQuery is almost identical.

Using the example from above, you would call

The rest works similarly. In fact, the Mailcheck jQuery plugin just wraps

Usage on Node.js

If you're running this on Node.js, you can just

to get the
object, and call
on that:
var mailcheck = require('mailcheck');{ // see 'usage without jQuery' above. });


Mailcheck has inbuilt defaults if the

options aren't provided. We still recommend supplying your own domains based on the distribution of your users.

Adding your own Domains

You can replace Mailcheck's default domain/TLD suggestions by supplying replacements to
  domains: ['', ''], // replaces existing domains
  secondLevelDomains: ['domain', 'yetanotherdomain'], // replaces existing SLDs
  topLevelDomains: ['', 'ru'] // replaces existing TLDs

Alternatively, you can extend Mailcheck's global set of default domains and TLDs by adding items to

Mailcheck.defaultDomains.push('', '') // extend existing domains
Mailcheck.defaultSecondLevelDomains.push('domain', 'yetanotherdomain') // extend existing SLDs
Mailcheck.defaultTopLevelDomains.push('', 'ru') // extend existing TLDs


The Mailcheck jQuery plugin wraps Mailcheck. The prime candidates for customization are the methods


Mailcheck currently uses the sift3 string similarity algorithm by Siderite. You can modify the inbuilt string distance function, or pass in your own when calling Mailcheck.

Since Mailcheck runs client side, keep in mind file size, memory usage and performance.


Mailcheck is tested with Jasmine. Run

npm test
from the command line to run the test suite. Alternatively, you can Load
in your browser.


Let's make Mailcheck awesome. We're on the lookout for maintainers and contributors.

And do send in those pull requests! To get them accepted, please:

  • Test your code. Add test cases to
    , and run it across browsers (yes, including IE).
  • Minify the plugin by running
    in the Mailcheck directory (npm install should have installed a git pre-commit hook that takes care of this for you).

Upcoming features, bugs and feature requests are managed in Issues.

Who uses Mailcheck?

Do you use Mailcheck? Tweet me your link.

Related Links

Core Team


Released under the MIT License.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.