What a hashed password actually is

A hashed password is a scrambled version of your real password that a website stores instead of the password itself. When you type your password into a login form, the website runs it through a mathematical function called a hash function, which turns it into a long string of characters that looks like random gibberish. The website then compares that scrambled version to the one it has on file. If they match, you get in.

The crucial part: the website never stores your actual password. It only stores the hash. This means that even if someone breaks into the company's database and steals the file of hashed passwords, they cannot straightforward read your password off the list. They would have to reverse-engineer the hash, which is designed to be extremely difficult or impossible to do.

Think of it like a one-way blender. You put your password in, it gets scrambled into a hash, and there is no button to unblend it back into the original. The same password always produces the same hash, so the website can verify you without ever knowing what you typed.

Key Takeaways

  • Hashed passwords are scrambled versions of your real password that websites store instead of the actual text.
  • A hash function is a mathematical process that always produces the same scrambled output for the same input, but cannot be reversed to recover the original password.
  • Even if a database of hashed passwords is stolen, attackers cannot easily read the real passwords from the hashes.
  • Not all hash functions are equally strong; older methods like MD5 are now considered weak, while bcrypt and Argon2 are much harder to crack.

Why websites use hashing instead of storing real passwords

If a website stored your actual password in plain text, a data breach would expose it when ready. An attacker could then use that password on your email, bank account, or anywhere else you reused it. Hashing removes that risk because the website itself does not need to know your real password—it only needs to verify that what you typed matches what it has on file.

Hashing also protects you from employees at the company. A database administrator or customer service representative cannot look up your password and use it elsewhere. They can only see the hash, which is useless to them without the original password.

How attackers try to crack hashed passwords

Even though hashes cannot be reversed, attackers have other ways to break them. The most common method is called a dictionary attack: the attacker takes a list of common passwords, hashes each one using the same hash function, and compares the results to the stolen hashes. If someone used "password123," the attacker's hash of "password123" will match, and they have found it.

Another method is a brute force attack, where the attacker systematically tries every possible combination of characters until a hash matches. This takes much longer but can work if the password is short or straightforward.

A third approach is using rainbow tables—pre-computed lists of millions of passwords and their hashes. An attacker downloads a rainbow table and searches it for matching hashes, which is faster than computing hashes on the fly.

The difference between weak and strong hash functions

Not all hash functions are equally difficult to crack. MD5 and SHA-1 are older methods that are now considered weak because modern computers can hash billions of passwords per second, making dictionary and brute force attacks practical. If a website is still using MD5 or SHA-1, a stolen database of hashed passwords is at serious risk.

bcrypt and Argon2 are modern hash functions designed to be slow on purpose. They deliberately take longer to compute, which slows down attackers trying millions of guesses. A bcrypt hash might take a tenth of a second to compute, which sounds fast until you realize an attacker would need years to try all common passwords. This slowness is a feature, not a bug.

A strong hash function also includes a salt—a random string added to your password before hashing. This prevents two people with the same password from having identical hashes, and it makes rainbow tables useless because each password would need its own entry for every possible salt.

What happens when you reset your password

When you reset your password on a website, you are not recovering the old one—you are creating a new hash. The website generates a temporary reset link that expires after a few hours and sends it to your email. You click the link, type a new password, and the website hashes and stores the new version. The old hash is discarded.

This is why no legitimate website can ever email you your password. They do not have it. If a company claims to have sent you your password in an email, that is a red flag that they are storing passwords insecurely.

How to choose a password that resists cracking

Even with a strong hash function, a weak password can still be cracked through dictionary attacks. The longer and more random your password, the harder it is to guess. A password like "correct-horse-battery-staple" (a random phrase) is stronger than "P@ssw0rd!" (a common pattern with a number and symbol substituted).

The best approach is to use a password manager like Bitwarden, 1Password, or KeePass, which generates and stores long random passwords for each site. You only have to remember one strong master password. Even if one website's database is breached, the attacker gets only that site's password, not your password for everywhere else.

What to do if your hashed password is stolen

If you learn that a website you use has been breached, change your password on that site when ready. If you reused the password elsewhere, change it on those sites too. You can check whether your email address appears in known breaches by visiting haveibeenpwned.com, which is a free service that collects data from public breaches.

Changing your password does not undo the breach—the attacker still has the old hash. But a new password means they cannot use the old one to log in, and if the new password is strong and the website uses a modern hash function, cracking it will take far longer.

Frequently Asked Questions

Can a website tell what my password is from the hash?

No. A properly designed hash function is one-way. The website can only verify that the password you typed produces the same hash as the one on file. It cannot reverse the hash to see your actual password, and neither can anyone else.

Why do some websites ask me to reset my password after a breach?

If the website used a weak hash function or stored passwords in plain text, the old hashes or passwords are now compromised. A new password creates a new hash, which the attacker does not have. If the website upgraded to a stronger hash function, the new password will be much harder to crack.

Is a hashed password completely safe from being cracked?

No hash is uncrackable, but modern functions like bcrypt and Argon2 make cracking impractical for most passwords. A short or common password can still be cracked through dictionary attacks, even with a strong hash function. A long, random password is far more resistant.

What is a salt, and why does it matter?

A salt is a random string added to your password before hashing. It ensures that two people with the same password have different hashes, and it makes pre-computed rainbow tables useless. Every password gets a unique salt, so an attacker cannot use shortcuts.

Should I worry if a website I use was hacked?

It depends on the website and how old the breach is. If it was recent and the website uses a modern hash function, your password is probably safe if it is long and random. If the breach was years old and the website used MD5, your password may have been cracked already. Change it and check haveibeenpwned.com to see what else was exposed.