Hash Generator

Generate SHA-256, SHA-384, SHA-512, SHA-1 and MD5 hashes or HMACs for text and files, and verify checksums, without uploading anything.

0 bytes
Output
Hash values of the input

Hashes are computed in your browser with the Web Crypto API (MD5 with built-in code). Text, files and keys never leave your device.

Advertisement

How to Use This Hash Generator

Type or paste text in the Text tab, and the MD5, SHA-1, SHA-256, SHA-384 and SHA-512 digests appear as you type. Text is converted to bytes as UTF-8, the encoding nearly every modern system uses, and the byte count under the box shows exactly how many bytes are hashed. To check a download, switch to File and choose or drop the file. Your browser reads it into memory and hashes it locally; nothing is uploaded, so even large ISO images work offline. The 2 GB browser limit applies.

Pick hex, HEX or Base64 output to match the format you're comparing against. Most download pages and command-line tools print lowercase hex, while HTTP headers such as Content-Digest and Subresource Integrity attributes use Base64. Tick HMAC with a secret key to compute keyed HMAC-SHA values instead, entering the key as text or hex bytes. To verify a checksum, paste the published value into Compare with an expected hash. The tool accepts hex or Base64, ignores prefixes such as sha256: and the filename that sha256sum prints, works out the algorithm from the length, and highlights the matching row.

What a Cryptographic Hash Function Does

A hash function turns input of any length into a fixed-length output, the digest. SHA-256 always produces 256 bits (64 hex characters), whether you feed it one letter or a 4 GB disk image. A cryptographic hash adds three security properties:

  • Preimage resistance: given a digest, you can't find an input that produces it.
  • Second-preimage resistance: given one input, you can't find a different input with the same digest.
  • Collision resistance: you can't find any two inputs with the same digest.

Hashes are also deterministic and show an avalanche effect: the same input always gives the same digest, while changing a single bit changes about half of the output bits. That is why a digest works as a fingerprint for data.

The SHA-2 family (SHA-224, SHA-256, SHA-384, SHA-512 and the truncated SHA-512/256 variants) is specified by NIST in FIPS 180-4. SHA-256 works on 32-bit words; SHA-384 and SHA-512 use 64-bit words and can be faster on 64-bit processors. All three are considered secure today. SHA-3 (FIPS 202) is a different design kept in reserve, not a replacement made necessary by any weakness in SHA-2.

Worked Example: SHA-256 of "abc"

Advertisement

Click Example: abc. The three characters are 3 bytes in UTF-8, and the tool shows the standard test vectors that NIST publishes for these algorithms:

  • SHA-256: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
  • SHA-1: a9993e364706816aba3e25717850c26c9cd0d89d
  • MD5: 900150983cd24fb0d6963f7d28e17f72 (the test vector from RFC 1321)

Switch to Base64 and the SHA-256 becomes ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=. Same 32 bytes, different text encoding. Now add a line break after abc. The input is 4 bytes and the SHA-256 changes completely, to edeaaff3f1774ad2888673770c6d64097e391bc362d7d6fb34982ddf0efd18cb. That trailing newline is the usual reason a hash from echo abc | sha256sum doesn't match: echo adds a newline unless you use printf 'abc' or echo -n. Windows line endings (\r\n) and invisible characters such as a byte-order mark cause the same kind of mismatch.

Hashing vs. Encryption vs. Encoding

These three are often confused, and the difference matters for security:

  • Encoding (Base64, URL encoding, hex) changes how data is written so it can travel through a text channel. There is no key, and anyone can reverse it. Our Base64 tool decodes any Base64 instantly.
  • Encryption (AES, RSA) protects confidentiality. Data can be turned back into the original, but only with the key.
  • Hashing is one-way. There is no key and no "decrypt", only recomputing and comparing.

"Hash decrypter" websites don't reverse anything. They look up digests of common inputs in huge precomputed tables, which is exactly why short or predictable inputs, such as passwords, need extra protection.

Why MD5 and SHA-1 Are Broken

Practical MD5 collisions were published in 2004, and RFC 6151 says MD5 must not be used where collision resistance is required. In 2017 the SHAttered project from CWI Amsterdam and Google published two different PDF files with the same SHA-1 digest. NIST announced in 2022 that SHA-1 should be phased out completely by December 31, 2030. Both still detect accidental corruption reasonably well, which is why old mirrors still publish MD5 sums. Neither can show that a file wasn't deliberately swapped by someone who could craft a collision, so use SHA-256 or stronger for anything that matters. This tool labels them for that reason.

Passwords Need Slow, Salted Hashes

SHA-256 is designed to be fast, and that is the problem for passwords: a single modern GPU can try billions of SHA-256 guesses per second against a stolen database. NIST's SP 800-63B-4 requires stored passwords to be salted and hashed with a suitable password hashing scheme, a deliberately costly key derivation function. OWASP's Password Storage Cheat Sheet recommends Argon2id first, then scrypt, bcrypt, or PBKDF2 with a high iteration count.

  • A unique random salt per user means identical passwords produce different hashes, and precomputed tables become useless.
  • The work factor makes each guess thousands of times more expensive.

Never store passwords as plain SHA-256 or MD5, salted or not. The hashes here are for checksums, fingerprints and learning. For creating strong passwords in the first place, see our password generator.

HMAC: Hashing With a Key

A plain hash proves only that data is unchanged, if you trust where the digest came from. An HMAC (RFC 2104) mixes a secret key into the hash, so only someone with the key can produce a valid tag. Webhook signatures from payment and source-control platforms, AWS request signing, and JWTs signed with HS256 are all HMACs. Don't build your own by hashing key + message: SHA-256 and SHA-512 are vulnerable to length-extension attacks with that construction, and HMAC's two-pass design avoids the problem. You can check the tool against RFC 4231 test case 2: key Jefe and message what do ya want for nothing? give an HMAC-SHA-256 of 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843.

Verifying a Download

Publishers list a SHA-256 next to installers and disk images so you can confirm the file arrived intact. On the command line, use sha256sum file on Linux, shasum -a 256 file on macOS, or Get-FileHash file -Algorithm SHA256 in PowerShell. Or drop the file into this page and paste the published value. A match proves the file is identical to the one the checksum describes. It doesn't prove that the checksum itself is genuine: if an attacker can change the download page, they can change both. That is why projects also sign their checksum files with GPG or Sigstore, and why the checksum should come over HTTPS from the official site. Our guide Cryptographic Hashing Explained covers these ideas in more depth.

Frequently Asked Questions

Can a SHA-256 hash be decrypted or reversed?

No. Hashing is one-way: there is no key and no decryption step. Sites that claim to reverse hashes simply look up digests of common inputs in precomputed tables, which only works for short or predictable inputs such as weak passwords.

Why doesn't my hash match the one from the command line?

The bytes are almost always different. The most common cause is a trailing newline added by echo; use printf or echo -n instead. Windows line endings, a byte-order mark, extra spaces, or a different text encoding also change the hash, as does comparing a hex value with a Base64 one.

Is MD5 or SHA-1 still safe to use?

Not for security. Practical collisions exist for both: MD5 since 2004 and SHA-1 since the SHAttered attack in 2017, and NIST plans to retire SHA-1 completely by the end of 2030. They still catch accidental file corruption, but use SHA-256 or stronger whenever someone might tamper with the data.

Should I hash passwords with SHA-256?

No. SHA-256 is fast, so attackers can test billions of guesses per second against a stolen database. Store passwords with a slow, salted password hashing function such as Argon2id, scrypt, bcrypt or PBKDF2, as NIST SP 800-63B-4 and the OWASP Password Storage Cheat Sheet describe.

What is the difference between a hash and an HMAC?

A hash has no key, so anyone can compute it, and it only shows that data is unchanged if you trust where the digest came from. An HMAC mixes in a secret key, so only someone who knows the key can create or check a valid tag. That makes HMACs suitable for webhook signatures, API request signing and HS256 JSON Web Tokens.

Are my files uploaded when I hash them?

No. The browser reads the file into memory on your device and hashes it with the built-in Web Crypto API (MD5 uses code included in the page). Nothing is sent to a server, so the tool also works offline once the page has loaded.

Sources: NIST FIPS 180-4 (Secure Hash Standard); NIST: SHA-1 retirement; SHAttered; RFC 1321 (MD5); RFC 6151; RFC 2104 (HMAC); RFC 4231 (HMAC-SHA test vectors); NIST SP 800-63B-4; OWASP Password Storage Cheat Sheet.

Related Articles

Expert guides and educational resources to help you master the math.

Advertisement