A hash function turns input of any length into a fixed-length fingerprint. The same input always produces the same hash; changing a single bit produces a completely different one. That makes hashes useful for verifying integrity and detecting change.
How to use the Hash Generator
- Paste the text you want to hash
- Pick an algorithm — SHA-256 unless you have a specific reason not to
- Copy the resulting hash
- To verify a file or message, hash both and compare the strings
Choosing an algorithm
- SHA-256 — the current default for anything security-related. No practical attacks exist. Use this unless something specifically requires otherwise.
- SHA-1 — cryptographically broken. A practical collision was demonstrated in 2017. Fine for non-security uses such as Git object naming or cache keys; never for signatures or certificates.
- CRC32 — a checksum, not a cryptographic hash. Fast, 32 bits, designed to catch accidental transmission errors. Trivially forgeable, so never use it for anything adversarial.
Hashing is not how you store passwords
This deserves emphasis because the mistake is still widespread. A plain SHA-256 of a password is not safe storage.
SHA-256 is designed to be fast, which is exactly wrong for passwords — a modern GPU computes billions per second, so an attacker with your hash table can brute-force weak passwords almost immediately. Unsalted hashes are also vulnerable to rainbow tables, and identical passwords produce identical hashes, which leaks information.
Password storage needs a deliberately slow, salted algorithm designed for the job: bcrypt, scrypt or Argon2. These have a tunable work factor so you can keep them slow as hardware improves.
Verifying a download with a checksum
The most common legitimate use of MD5 and SHA-256 outside cryptography is confirming that a file arrived intact. A publisher lists the digest of the original; you compute the digest of what you received and compare.
This catches truncated downloads, corruption in transit, and the wrong file entirely. It does not, on its own, prove the file is genuine — if an attacker can replace the download they can usually replace the checksum listed beside it. A checksum published on a different host, or signed with a key you already trust, is what turns an integrity check into an authenticity check.
Comparing digests by eye is unreliable; people check the first and last few characters and miss the middle. Paste both into a diff, or use your operating system's comparison. On Windows, certutil -hashfile file SHA256; on macOS, shasum -a 256 file; on Linux, sha256sum file.
MD5 is adequate here despite being broken for signatures, because accidental corruption is not an adversary. Where the publisher offers SHA-256, use it anyway — there is no cost.
Why a hash of the same text can differ
Hashing is deterministic: identical input always produces identical output. When two digests of apparently identical text disagree, the input differed in a way you could not see.
A trailing newline is the most frequent cause. Most editors add one at the end of a file; a text box usually does not. One byte changes the entire digest.
Line endings. A file saved on Windows uses carriage return plus newline; the same file on Linux uses newline alone. Every line differs by one byte.
Character encoding. Hashes operate on bytes, not characters. The same accented letter is two bytes in UTF-8 and one in Latin-1, so the same visible text in two encodings hashes differently. This is why tools should state that they hash the UTF-8 representation.
Invisible characters. A byte order mark at the start of a file, a non-breaking space pasted from a web page, or a zero-width character all change the input without changing the appearance.
If a digest will not match, compare byte counts first. A difference of one or two usually identifies which of these it is.
Frequently asked questions
Can a hash be reversed?
No. Hashing is one-way by design. Short or common inputs can be found by brute force or lookup tables, but the function itself cannot be inverted.
Should I use this to hash passwords?
No. Use bcrypt, scrypt or Argon2 on your server. General-purpose hashes are far too fast to resist brute-force attacks on passwords.
Is SHA-1 still safe?
Not for security. A practical collision was demonstrated in 2017, so it must not be used for signatures or certificates. It remains acceptable for non-adversarial uses like content addressing.
Why do I get a different hash for seemingly identical text?
Almost always a trailing newline, a trailing space, or different line endings — \r\n versus \n. Hashes are byte-exact, so any invisible difference changes the output completely.