Hash Generator · Tutorial

How to hash an email address with SHA-256 for list matching

5 min readbeginnerUpdated

Advertising platforms, customer-data tools and partner integrations often ask for emails as SHA-256 hashes rather than plain text. If you hash them slightly differently from the other side, nothing matches. This tutorial shows the normalisation steps that matter and how to check a hash before uploading a whole list.

What you need

  • The Hash Generator
  • A sample email address (the Try it button loads one with typical formatting problems)

Steps

  1. Look at the raw value

    The sample is Amara.Okafor@Example.com , with spaces at both ends and capital letters, exactly as it might appear in a CRM export. Hashing it as it is gives a hash nobody else will produce.

  2. Normalise it

    Trim spaces at both ends and convert everything to lowercase, giving amara.okafor@example.com. These two steps are required by almost every platform. Check your platform's guide for any extras, such as how dots in Gmail addresses are treated.

  3. Hash the normalised email

    Type or paste the normalised address into the box. The SHA-256 appears instantly. Keep it lowercase hex unless the platform asks otherwise.

    29a805dddae9c60ee6d941a75546ed33eab13c9f38effbfdb0ba37a81fd3c9c2
  4. Check against your code

    Before hashing thousands of addresses in a spreadsheet or script, hash one test address in your code and compare it with the tool, using the compare box. If they match, your normalisation and encoding are correct.

    hashlib.sha256(email.strip().lower().encode('utf-8')).hexdigest()

Try it yourself

Opens the Hash Generator with this tutorial's sample loaded.

Try it now

Common mistakes

Hashing before normalising
Any difference, even a trailing space, gives a completely different hash. Always trim and lowercase first.
Hashing twice
Some upload tools hash for you. If you upload already-hashed values to a tool that hashes again, nothing matches. Check whether the platform expects raw or hashed values.
Treating hashes as anonymous
Common emails can be hashed and compared by anyone, so a hash of an email is still personal data under most privacy laws. Handle hashed lists with the same care and consent as the originals.

Next steps

Go back to the Hash Generator, or keep going with one of these:

FAQ

Should phone numbers be hashed the same way?

Usually they're first converted to international E.164 format (like +64211234567, digits only with a leading +), then hashed. Check the platform's rules.