MD5, SHA-1, SHA-256, SHA-512

Hash any text snippet.

Compute MD5, SHA-1, SHA-256, and SHA-512 digests of input text in the browser. Useful for verifying short text payloads. Pure browser; no login.

Hash functions: MD5, SHA-1, SHA-256 and SHA-512

A hash function turns any input into a short fingerprint of fixed length, called a digest. The same input always gives the same digest, and changing a single character changes it completely. That makes hashes useful for checking that a download is intact, comparing data without storing it, building cache keys and signing messages.

This page computes four common digests at once as you type. SHA-1, SHA-256 and SHA-512 come from the browser's built-in WebCrypto; MD5, which WebCrypto does not offer, comes from a small bundled library. Your text never leaves the page.

How to use it

  1. Type or paste text into the input box.
  2. Read all four digests below it; they update with every keystroke.
  3. Copy the digest you need. All are lowercase hexadecimal, the format most tools print.
  4. To verify a checksum someone published, paste the original text and compare the digest character by character, or paste both into a diff tool.

Example: the word hello

Input
hello
Output
MD5: 5d41402abc4b2a76b9719d911017c592
SHA-256: 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

MD5 digests are 128 bits (32 hex characters); SHA-256 digests are 256 bits (64 hex characters). Type Hello with a capital H and both change entirely.

Which algorithm to choose

SHA-256 is the safe default for anything new: file checksums, content addressing, API signatures with HMAC, and integrity checks. SHA-512 is just as safe and can be faster on 64-bit machines; it simply gives a longer digest.

MD5 and SHA-1 are broken for security. Researchers can create two different inputs with the same MD5 digest in seconds, and Google published a practical SHA-1 collision in 2017. They remain fine for non-adversarial jobs such as spotting accidental corruption or deduplicating files you control, and you will still meet them in older systems and Git object IDs.

Hashes are not encryption

A hash cannot be decrypted, because it throws information away. But for short or predictable inputs, an attacker can simply hash every candidate and compare. That is why passwords must never be stored as a plain SHA-256 digest: use a slow, salted password hash such as Argon2, scrypt or bcrypt instead.

Why your digest might not match

Hashes work on bytes, so invisible differences matter. A trailing newline, Windows line endings (CRLF) versus Unix ones (LF), a different Unicode form of an accented letter, or a text encoding other than UTF-8 all produce a different digest. This tool hashes exactly the UTF-8 bytes of what is in the box.

Questions

Can I reverse a hash to get the text back?

No. Websites that claim to do so only look the digest up in tables of previously hashed common words. Unique, long input cannot be recovered.

Can I hash a file here?

This page hashes text. On a computer you can hash a file with sha256sum on Linux, shasum -a 256 on macOS, or Get-FileHash in Windows PowerShell.

Why does the terminal give a different result for echo hello?

echo adds a newline, so it hashes hello followed by a line break. Use echo -n hello or printf hello to hash the same bytes as this page.