Skip to content

Hash Generator - MD5, SHA-1, SHA-256, SHA-512 Online

Hash Results
MD5—
SHA-1—
SHA-256—
SHA-384—
SHA-512—

Five Hashes of the Same Input

Type or paste text and the tool shows its MD5, SHA-1, SHA-256, SHA-384 and SHA-512 digests together, each as lower-case hex with its own copy button. That is handy when you have a checksum but no label saying which algorithm produced it: the length tells you.

Algorithm Bits Hex length Hash of "hello" (first 16 chars)
MD5 128 32 5d41402abc4b2a76…
SHA-1 160 40 aaf4c61ddcc5e8a2…
SHA-256 256 64 2cf24dba5fb0a30e…
SHA-384 384 96 59e1748777448c69…
SHA-512 512 128 9b71d224bd62f378…

Paste hello (no newline) to check the tool against these values. Text is encoded as UTF-8 before hashing, which is what sha256sum, Python's hashlib and Node's crypto do with a UTF-8 string.

Getting the Same Hash as Your Code

A hash changes completely if a single byte changes, so the input has to match exactly. The usual mismatches:

  • Trailing newline. echo "hello" adds \n. Use printf 'hello' or echo -n.
  • Line endings. A file saved on Windows has \r\n. Browsers turn line breaks in a text box into \n, so a CRLF file and the same text pasted here hash differently.
  • Unicode normalisation. "café" typed with a single é and "café" built from e plus a combining accent look identical but are different bytes, so they produce different hashes.
  • Hex vs Base64. Some APIs and Subresource Integrity attributes show the digest in Base64. The bytes are the same; only the notation differs.

Which One to Pick

MD5 and SHA-1 are fast and everywhere, but collisions can be manufactured for both, so they are only fit for spotting accidental changes. SHA-256 is the default for new work. SHA-384 is SHA-512 truncated with different starting values, and shows up mainly in TLS cipher suites and integrity="sha384-..." attributes. None of these are suitable for storing passwords on their own: they are designed to be fast, which helps attackers guess. Use bcrypt, scrypt or Argon2 for passwords.

Each algorithm also has its own page with more detail: MD5, SHA-1, SHA-256 and SHA-512. To sign a message with a secret key, use the HMAC generator. If you need to get the original data back later, a hash is the wrong tool; use an encoding such as Base64 or proper encryption.

Related Tools

Frequently Asked Questions

Which hash algorithm should I use?
SHA-256 for anything new: checksums, signatures, content addressing. Use SHA-512 or SHA-384 if a spec asks for them. Use MD5 or SHA-1 only to match an existing system, such as an old checksum file, an S3 ETag or a Git object ID. Neither is safe where someone might deliberately craft a collision.
Why doesn't my hash match the one from sha256sum or md5sum?
Almost always a trailing newline. echo "hello" | sha256sum hashes "hello\n", which gives 5891b5b5... instead of 2cf24dba... for "hello". Use echo -n or printf. The other usual causes are Windows CRLF line endings, a leading or trailing space, or comparing upper-case hex with lower-case hex (they are the same value).
What is the difference between hashing and encryption?
Encryption is reversible if you have the key. Hashing is not reversible at all: there is no key, and the digest does not contain the input. Use encryption to keep data secret and get it back; use a hash to check that data has not changed.
Can a hash be decoded or reversed?
No. "Hash decrypter" sites look your hash up in tables of precomputed hashes of common words and leaked passwords, so they only find short or popular inputs. Salting each value with random data defeats those tables.
Can I hash a file here?
Not at the moment. The tool hashes the text you type or paste, encoded as UTF-8. For files, use sha256sum file (Linux), shasum -a 256 file (macOS) or Get-FileHash file (PowerShell, SHA-256 by default).
Is my input sent anywhere?
No. SHA-1 and the SHA-2 family use the browser's Web Crypto API, and MD5 (which Web Crypto does not provide) runs in a small JavaScript implementation on the page. You can confirm in the network tab that nothing is sent.