What a hash function does
A cryptographic hash takes input of any length and produces a fixed-length output — a digest. SHA-256 always returns 64 hexadecimal characters whether you feed it one letter or a gigabyte file.
Three properties make it useful:
- Deterministic. The same input always produces the same digest, on any machine, forever.
- Avalanche effect. Changing a single bit of input changes roughly half the output bits. Similar inputs produce completely unrelated digests.
- One-way. Given a digest, there is no practical method of recovering the input.
This tool uses the browser's native crypto.subtle.digest, so your text never leaves the device.
Hashing is not encryption
This confusion causes real security mistakes, so it is worth being precise.
Encryption is reversible. It takes plaintext and a key and produces ciphertext that the key can turn back into plaintext. The whole point is recovering the original.
Hashing is one-way. There is no key and no decryption. You cannot “decrypt a hash” because nothing was encrypted — the input was consumed to produce a fingerprint.
Sites that appear to reverse hashes are running lookup tables of precomputed digests for common inputs. They are not reversing the function; they are recognising a value they have seen before. That distinction is exactly why salting matters for passwords.
What each algorithm is for
SHA-256 is the sensible default. It is part of the SHA-2 family, has no known practical weaknesses, and is used in TLS certificates, Bitcoin, Git object addressing, and file integrity checks throughout the industry.
SHA-384 and SHA-512 produce longer digests. On 64-bit hardware SHA-512 is often faster than SHA-256 because it operates on 64-bit words. Use them where a longer digest is specified.
SHA-1 is broken for security purposes. A practical collision was demonstrated in 2017 — two different PDFs with the same SHA-1 digest. It remains in use for non-security purposes such as Git commit identifiers, but should never be used for signatures, certificates, or anything where an attacker benefits from forging a match.
MD5 is not offered here. It has been thoroughly broken since 2004 and collisions can be produced in seconds. It is unsuitable for any security purpose.
Where hashes are actually used
File integrity. Software distributors publish a SHA-256 digest alongside a download. Hashing the file you received and comparing confirms nothing was corrupted or tampered with in transit.
Deduplication. Storage systems hash file contents; identical hashes mean identical files, so only one copy is stored.
Content addressing. Git identifies every object by the hash of its contents, which is why a commit ID changes whenever anything in its history changes.
Digital signatures. Signing a large document directly is slow, so the document is hashed and the small digest is signed instead.
Blockchains. Each block includes the hash of the previous one, which is what makes the chain tamper-evident.
An important warning about passwords
Do not use a plain SHA hash to store passwords. SHA algorithms are designed to be fast, and speed is precisely what an attacker wants — modern hardware can compute billions of SHA-256 hashes per second, making brute-force feasible against most real passwords.
Password storage requires a deliberately slow, memory-hard algorithm with a unique random salt per password. The current recommendations are Argon2id, bcrypt, or scrypt. Each has a tunable work factor so the cost can be raised as hardware improves.
The salt matters as much as the algorithm. Without it, identical passwords produce identical digests, so cracking one account cracks every account sharing that password — and precomputed rainbow tables become effective.
Frequently asked questions
Can a hash be reversed or decrypted?
No. Hashing is one-way and involves no key, so there is nothing to decrypt. Sites that appear to reverse hashes are looking values up in precomputed tables of common inputs.
Which hash algorithm should I use?
SHA-256 for almost everything. SHA-384 or SHA-512 where a longer digest is required. Avoid SHA-1 and MD5 for anything security-related, since both have practical collision attacks.
Is SHA-256 safe for storing passwords?
No. It is too fast, allowing billions of guesses per second on modern hardware. Use Argon2id, bcrypt, or scrypt with a unique random salt per password.
Why do two similar texts produce completely different hashes?
That is the avalanche effect. Changing one bit of input flips roughly half the output bits, which is a deliberate design property that prevents inferring anything about the input from the digest.