An email address run through a one-way function such as SHA-256, giving a code that can be matched against other codes but not turned back into the email.
Hashing turns priya@haldenfreight.example into a fixed-length string of letters and numbers. The same email always gives the same hash, so two systems can tell whether they hold the same address without either revealing it. The hash can’t be reversed.
Two cautions. First, emails must be normalized (trimmed and lowercased) before hashing, or the same address gives different hashes. Second, a hash of a known email is still personal data: anyone holding the email can compute the hash and match it. Hashing is minimization, not anonymization.
How it works
A hash function takes any input and produces an output of fixed length. SHA-256, the most common choice, always produces 256 bits, usually written as 64 hexadecimal characters. Change one letter of the input and the output changes completely. Going backwards, from the output to the input, isn’t feasible: the only way to find which email made a hash is to guess emails, hash them, and compare.
Why normalizing matters
Priya@HaldenFreight.example, priya@haldenfreight.example with a leading space, and priya@haldenfreight.example are the same mailbox but three different inputs, so they give three different hashes. Systems that want to match agree on a standard first: usually trim spaces and lowercase the whole address. California’s DROP asks brokers to standardize records in the same spirit before hashing and matching.1
- 01An email addressAs someone typed it
- 02NormalizeTrim spaces, lowercase
- 03HashSHA-256
- 0464 charactersThe same mailbox always gives the same code
What hashing protects, and what it doesn’t
- It protects the address in transit and at rest. A leaked list of hashes doesn’t directly reveal anyone’s email.
- It lets two parties match without sharing raw data. Each hashes its own list, and they compare codes.
- It doesn’t make the data anonymous. Anyone with a list of emails can hash them and look for matches. Common addresses can be guessed. A hash still points to one person.
- It doesn’t hide anything else on the record. If a hash sits beside a name and a job title, the record is plainly about a person.
Where you’ll meet hashed emails
- Identity graphs, which link browsers to people by hashed email.
- Ad platforms, which match a business’s customer list to their users by hash.
- Suppression lists and opt-outs, which keep the hash rather than the address, so the list of people who asked to be forgotten isn’t a list of their emails.
- Deletion platforms such as California’s DROP, whose identifiers are all hashed.1
Salting, and why matching avoids it
A salt is a secret value added before hashing, so the same email gives a different hash in each system. That’s good for storing passwords and bad for matching, because two systems with different salts can never compare. Matching systems therefore use unsalted hashes, which is exactly why a hashed email still counts as personal data.
Common mistakes
- Hashing without normalizing, so the same person gets two codes and matches fail.
- Calling hashed data anonymous in a privacy notice. It isn’t, and saying so misleads.
- Mixing hash functions. An MD5 code and a SHA-256 code of the same email never match.
- Keeping the raw email next to the hash, which defeats the point of hashing it.
Questions
Is a hashed email “anonymized” under privacy law? Generally no. Treat it as personal information, and say in your privacy notice if you share it.
Can a vendor turn our hashes back into emails? Not from the hash alone. It can match them against emails it already has.
An example
Two companies want to know how many customers they share, without handing each other their customer lists. Each trims and lowercases its own emails, hashes them with SHA-256, and sends only the hashes to the other. Matching codes mean shared customers. Neither learns any email it didn’t already have, but each now knows which of its own customers the other has, which is itself information about those people. That’s the sense in which a hash is minimization, not anonymity.
Which hash function should we use? Whichever the other party uses. SHA-256 is the common choice.
In Namorus: when a visitor submits a form with an email box, or a site calls identify(), the tag trims, lowercases and hashes the email with SHA-256 in the visitor’s browser, and sends the hash with the email, which is kept for that site’s owner only; contact uploads are hashed in the customer’s browser the same way. Every email Namorus holds is kept with its hash, so an opt-out by any address finds every copy. An email entered on our opt-out page is hashed the moment it reaches us, and only the hash is kept. The app can’t read hashed emails at all. Install the tag.