The problem with the obvious design
The naive breach checker takes your password, sends it to a server, looks it up, and tells you the answer. Even if the operator is honest, the password has now travelled over a network, landed in a request log, and sat in a server's memory. A checker that works this way is indistinguishable from a phishing page, and you should treat it as one.
The second attempt sends a hash instead. Better, but a full SHA-1 hash of a password is still a fingerprint: anyone holding a list of hashes of common passwords, which is exactly what a breach database is, can match it instantly. The server learns your password the moment it finds a match.
So the question is how to ask "is this in your list" without handing over enough to identify the thing being asked about. The answer is called k-anonymity, and it is the one piece of cleverness behind every breach checker worth using.
Five characters, several hundred candidates
Hash the password on your own device. SHA-1 produces forty hexadecimal characters. Send the first five and keep the other thirty-five.
Five hex characters have about a million possible values, and the database holds several hundred million passwords, so each five-character prefix matches a few hundred of them. The server sends back every suffix it has for that prefix, with a count for each. Your device looks through the list for its own thirty-five-character suffix.
The server has learned that your password's hash starts with, say, 5BAA6. That narrows it to one of the few hundred passwords in that bucket, among them "password", a few dozen names, and a scattering of random strings. It cannot tell which, and the response it sent is the same regardless of which one you were interested in. The password breach checker prints those five characters on screen before you press the button, so there is nothing to take on trust.
Why SHA-1, when SHA-1 is broken
SHA-1 is no longer safe for signatures, because collisions can be manufactured. None of that matters here. The hash is not protecting anything; it is a lookup key, chosen because the breach database was built around it and because a prefix of it spreads passwords evenly across buckets. The hash generator will show you the full hash of any string if you want to see the mechanism with your own eyes.
What protects the password is that only a fifth of the hash leaves the device, and a fifth of a hash is not enough to rebuild anything.
What a count actually means
Zero means the password has not appeared in any breach the service knows about. Not that it is strong, not that it is unique, just that nobody has leaked it yet, or at least not somewhere public.
One or two means a specific breach somewhere included it. One match is already enough to change it: attackers run every leaked list against every login they can reach, and a password that worked once anywhere is on those lists.
Millions means it is on the shortlist that is tried first, within seconds of any attack. The textbook example is the word password itself, which the database holds tens of millions of times. If your password has a count in the millions, the question is not whether to change it but how many accounts it is protecting right now.
The check is the diagnosis, not the cure
A clean result on a short, reused password is a false comfort. The thing that actually prevents the next breach from hurting you is a password that is long, random, used in exactly one place, and stored in a manager so that you never need to remember it. The password generator produces those, and a sixteen character random string has never been in a breach and will not be.
For a password you must hand to another person, the text encryptor is the companion piece: encrypt it with a separate passphrase, send the ciphertext by one route and the passphrase by another, and the chat log keeps nothing useful.
Questions people ask
Yes, on a checker that uses the k-anonymity range method: the password is hashed on your device and only the first five characters of the hash are sent, which identifies a bucket of a few hundred passwords and nothing within it. A checker that sends the password itself, or the full hash, is not safe, however reassuring its padlock icon.
A way of asking about one item while hiding it among k others. Here, sending a five-character hash prefix puts your password in a group of several hundred that share the prefix, and the server cannot tell which one you asked about. The matching happens on your device.
Some breach somewhere included it. One appearance is enough to change it everywhere it is used, because leaked lists are what attackers try first against every service, and a password that appeared once is on those lists forever.
It has not leaked, as far as the database knows. Whether it is strong is a separate question: a short or guessable password can be clean today and cracked tomorrow. Length and randomness are what protect against guessing, and only a generated password gives you both.
So you can see exactly what will leave your device. Five characters of a SHA-1 hash cannot be reversed into a password, and showing them is the simplest proof that the password itself is not being sent.

