MD5 and SHA Hash Generator
Paste text or drop a file to see MD5, SHA-1, SHA-256, SHA-384 and SHA-512 at once. To check a download, paste the published hash and the page tells you whether it matches. Text and files never leave your browser.
MD5 and SHA-1 are fine for checksums and compatibility with older systems, not for security. A hash is not encryption either: there is no key and no way back to the original text.
Result
No hash yet
Type some text or choose a file. Each selected algorithm shows up here with a copy button.
Case, spaces and prefixes like sha256: are ignored. The algorithm is inferred from the length.
Need to check a webhook signature? It uses HMAC, which is a hash with a secret key.
Storing a password? MD5 and SHA are too fast for that. Create a bcrypt hash for your test user.
What is a hash
A hash function turns any input, from a single word to a file of several gigabytes, into a fixed-size value: 32 hex characters for MD5, 64 for SHA-256. The same input always gives the same hash, and changing a single bit changes the whole result. That's why a hash works as a fingerprint of the content. It isn't encryption, because there's no key and no way back. Sites that claim to decrypt MD5 only look the hash up in a list of common passwords they computed in advance.
Length and use of each algorithm
| Algorithm | Hex characters | Where it shows up |
|---|---|---|
| MD5 | 32 | ETag, Content-MD5, deduplication and legacy integrations. Not for security. |
| SHA-1 | 40 | Git commits and legacy systems. Collision demonstrated in 2017. |
| SHA-256 | 64 | Release checksums, Docker, SRI, TLS and JWT HS256. The default choice. |
| SHA-384 | 96 | Subresource Integrity and certificates. |
| SHA-512 | 128 | Long hash when a specification asks for it. Fast on 64-bit CPUs. |
| SHA3-256 | 64 | Specifications that require SHA-3. A different construction from SHA-2. |
| SHA3-512 | 128 | Same case as SHA3-256, with a longer output. |
| CRC32 | 8 | zip, gzip, PNG and networking. Detects accidental errors, not tampering. |
MD5 and SHA-1: broken, but still around
The first MD5 collision was published in 2004, and today two different inputs with the same MD5 take seconds on a laptop. In 2017 Google published two PDFs with the same SHA-1. That rules both out for digital signatures, certificates and passwords. They still work for spotting accidental corruption, and you'll find them in server and S3 ETags, in Content-MD5, in file deduplication, in older integrations that sign requests with MD5 and in Git commits, which still use SHA-1.
SHA-256, SHA-384 or SHA-512
All three belong to the SHA-2 family and remain secure. SHA-256 is the de facto standard: release checksums, Docker, Bitcoin, TLS and JWT HS256. SHA-512 produces 128 characters and is often faster than SHA-256 on 64-bit CPUs. SHA-384 is a truncated SHA-512 and shows up in Subresource Integrity (integrity="sha384-...") and in certificates. SHA-3 is a different construction, useful when a specification asks for it, but it doesn't replace SHA-2 because of any flaw.
How to verify a download checksum
Projects such as Ubuntu, Node.js and Python publish a SHA256SUMS file next to the download. Drop the downloaded file here and paste the matching line into the expected hash field. In the terminal, the same check is sha256sum file.iso on Linux, shasum -a 256 file.iso on macOS and Get-FileHash file.iso in PowerShell, which prints the hash in upper case. Upper and lower case don't change the value.
Why the same text gave a different hash
It's almost always invisible bytes. echo "password" | md5sum includes the trailing line break, and echo -n doesn't. Files saved on Windows use CRLF (\r\n) and on Linux LF (\n). An editor may have added a BOM at the start, and the text may be in Latin-1 instead of UTF-8, which changes the bytes of é and ñ. Use the line break selector and the byte counter to find the difference.
Don't store passwords with MD5 or SHA
MD5 and SHA were designed to be fast, and an ordinary graphics card tests billions of hashes per second. With a list of leaked passwords, most password hashes in MD5 or SHA-256 fall within minutes, with or without a fixed salt. For passwords, use an algorithm that is slow on purpose, with a per-user salt, such as bcrypt or Argon2.
Frequently asked questions about hashing
MD5, SHA, file checksums and the reasons a hash doesn't match.