Introducing email-to-name.js

Turning email addresses into meaningful data

Tait Brown
Sep 4, 2018 · 3 min read

A user’s digital footprint can reveal a lot about them. Their IP address might provide the location of their nearest internet exchange, while an SSO provider like Google could reveal their full name and so much more. But even a simple email address can help us get to know our users a little more.

One outlandishly expensive way of deriving information from an email address is by the use of an identity resolution services. They maintain enormous databases of user identities and charge handsomely for the privilege. FullContact provides one such service, with a business plan starting at $499/mo. That could be a worthwhile spend if you want to know absolutely everything there is to know about your audience, but what if you want substantially less information for simple needs like personalisation?

Email-to-name is a tiny script that attempts to derive a name, you guessed it, from an email address. It relies on a series of common patterns we creatures of habit often follow when deciding on an email address. It attempts to reverse engineer a useable name or nickname with a series of regexes. I created this because surprisingly, this didn’t exist anywhere online.

Email Addresses Often Follow Rules

Personal Domain Patterns Exist Too

There’s No Harm in Taking a Guess

“Show the user what you know about them,

and allow them to correct it”

Users are inherently lazy. Despite your best intentions, they want to side step your boring on boarding process and get straight to the core of your product offering. The onus is therefore on you, the developer or designer, to ensure that mandatory fields are pre-filled with sensible guesses. But it’s okay to get it wrong, provided you show the user your best guess, and allow them to modify it themselves.

So check it out. It’s not an elaborate script, it’s merely a bunch of regexes. I don’t really get to hack on anything in my spare time any more — so please grant me this dalliance.

Tait Brown

Written by

I'm a UX designer/developer. I make stuff and tweet about shit user experiences. Works at A Cloud Guru.