Have I Been Pwned (HIBP) is a free service that tells you whether your email address appears in known data breaches and whether a password appears in its list of leaked passwords. Password checks use a k-anonymity range search: your device hashes the password and sends only the first 5 characters of the hash, so the service never learns the password.
What the two searches do
| Email search | Pwned Passwords | |
|---|---|---|
| Question it answers | Which known breaches included this address? | Has this exact password appeared in a breach, and how often? |
| What you send | The email address | The first 5 hex characters of the password's SHA-1 hash |
| Programmatic access | Paid API key (hibp-api-key header) | Free, no key, no rate limit |
| Linked to the other? | No. Passwords are not stored next to any personal data, so a hit on one never tells you about the other. | |
"Pwned" is gamer slang derived from "owned", meaning controlled or compromised.
How the password check avoids seeing your password
A naive design would send the password, or its hash, to the server. Both are bad: the first exposes the password, and an unsalted SHA-1 hash of a weak password can be reversed by lookup. HIBP uses a range query instead:
- Your device computes the SHA-1 hash of the password.
- It sends only the first 5 hex characters (the prefix) to
https://api.pwnedpasswords.com/range/{prefix}. - The server returns every leaked hash suffix that starts with that prefix, each with a count.
- Your device looks for its own suffix in that list. The match happens locally.
Five hex characters give 165 = 1,048,576 possible buckets. Each bucket holds hundreds of different hashes, so the server cannot tell which one, if any, you were checking. When Cloudflare designed this scheme in 2018, the average bucket held 478 hashes; the dataset has grown since.
A real lookup, using "password"
This is the full exchange for the deliberately terrible password password. Run it on Linux, macOS or Git Bash:
printf 'password' | sha1sum
5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 -
The prefix is 5BAA6 and the suffix is 1E4C9B93F3F0682250B6CF8331B7EE68FD8. Only the prefix goes over the network:
curl -s -A "my-check-script" https://api.pwnedpasswords.com/range/5BAA6 | grep 1E4C9B93F3F0682250B6CF8331B7EE68FD8
Output, as of October 2026:
1E4C9B93F3F0682250B6CF8331B7EE68FD8:52372427
That password has been seen 52,372,427 times in breach data. The full response for this prefix was 1,977 lines in the same format, for example 003CD215739D7C1B2218670D26F81408237:2. The API requires a User-Agent header; a request without one gets HTTP 403. printf is used instead of echo because echo adds a newline, which changes the hash.
Use this method with throwaway examples, not your real passwords: anything typed into a terminal can end up in shell history. For your own passwords, use the form on the Pwned Passwords page: it hashes the password locally and sends only the first 5 characters of the SHA-1 hash, the same exchange as above.
Padding
The response size itself can leak a little: different prefixes return different numbers of lines. Sending Add-Padding: true makes the API add fake entries with a count of 0, so responses vary randomly in size. Clients discard every line ending in :0. There is also an NTLM mode (?mode=ntlm) for checking Windows domain password hashes.
How the email search works
When a breach becomes public, its email addresses are loaded into HIBP along with a description of the breach: the date, the site and which data types leaked (passwords, phone numbers, addresses). Searching your address on the website lists every loaded breach that included it. The FAQ says searches are not logged, so the site does not collect the addresses people look up.
A few parts work differently:
- Sensitive breaches do not appear in public searches. Only the verified owner of the address sees them, after signing in through a link sent to that address.
- Notify me sends an email when your address shows up in a newly loaded breach. Notifications go only to the address being monitored, so you cannot subscribe someone else.
- Domain search lets an organisation list breached addresses on its own domain, after proving it controls that domain.
- Stealer logs come from malware on infected computers rather than a breached company. HIBP records which website domains each address was captured against.
The API version of the email search needs a paid key, sent in the hibp-api-key header. A 200 response means the address was found; a 404 means it was not.
What a result means
Your email was found. Read which data was in each breach. If passwords leaked, change the password for that site and for every other site where you used the same one. Turn on two-factor authentication there. If phone numbers or addresses leaked, expect more convincing phishing; see how to spot phishing.
Your password was found. Stop using it everywhere. HIBP's guidance is that a pwned password should no longer be used. A high count means it is in the lists attackers try first; even a count of 1 means it is in a public list. A password manager that generates a unique password per site makes this a non-event; see how password managers work.
Nothing was found. That is not a clean bill of health. HIBP only knows breaches that have been disclosed and loaded. Unique passwords and two-factor authentication still matter.
Is Have I Been Pwned legitimate?
Its design means you can check a password without trusting it with the password, and you can verify that yourself: the curl command above shows everything that leaves your machine. The email search does require sending the address, but the site states it does not log searches. Look-alike sites exist, so type haveibeenpwned.com yourself rather than following a link from an email.
To understand why a leaked password list is so dangerous even when the original site stored hashes, see hashing vs encryption and how long it takes to crack a password.
Frequently asked questions
- Is it safe to type my password into Have I Been Pwned?
- The Pwned Passwords page hashes the password in your browser and sends only the first 5 characters of the SHA-1 hash, so the service never receives the password or its full hash. Even so, the safer habit is to let your password manager run the check, or to test only passwords you have already decided to change.
- If my email is not found, am I safe?
- No. The site only knows about breaches that have been made public and loaded into its database. Have I Been Pwned's own FAQ says an address not being found does not mean it has not been compromised in another breach.
- Does Have I Been Pwned store my password with my email?
- No. The FAQ states that no password is stored next to any personally identifiable data. Email addresses and passwords are separate datasets, so the site cannot tell you which of your passwords leaked in a given breach.
- Why can't I see some breaches for my email?
- Breaches marked as sensitive are not shown in public searches. They are visible only to the verified owner of the address, after signing in to the site's dashboard with a link sent to that address.