Hash Generator
Generate SHA-1, SHA-256, SHA-384 or SHA-512 hashes from text — computed locally using the Web Crypto API.
- Free — No signup required
- Instant — Results update as you type
- Private — Processed in your browser
A cryptographic hash condenses any input into a fixed-length fingerprint: change one byte and the fingerprint changes completely, and there is no practical way to run the function backwards. This tool computes the three SHA-2 family digests supported by browsers, plus SHA-1 for compatibility, using the Web Crypto API rather than a JavaScript reimplementation.
How it works
Type or paste text, pick an algorithm, and the digest appears as lowercase hexadecimal. The text is converted to UTF-8 bytes with TextEncoder, then handed to crypto.subtle.digest, the browser's native implementation. The hash is recomputed on every keystroke and nothing is sent anywhere.
Output lengths are fixed by the algorithm: SHA-1 gives 40 hex characters (160 bits), SHA-256 gives 64, SHA-384 gives 96 and SHA-512 gives 128. If a downstream system expects Base64 rather than hex, run the hex through a converter or compute the digest with a command-line tool that offers that output.
Two details trip people up when a hash does not match one computed elsewhere. First, the input is hashed exactly as typed, so a trailing newline or a stray space changes the result; most shell tools append a newline unless told not to. Second, the bytes are UTF-8. A file saved as UTF-16 or Latin-1 hashes differently even though it displays identically.
The Web Crypto API is only exposed on secure origins, which is why the tool requires HTTPS. MD5 is absent because browsers do not implement it, and because it has been unsuitable for security use for many years.
Reproducing the result elsewhere
The same digests on Linux and macOS, with printf rather than echo so no newline is added:
printf '%s' 'hello world' | sha256sum
printf '%s' 'hello world' | openssl dgst -sha512
sha256sum prints the hex followed by a dash for standard input; openssl dgst prefixes the algorithm name. Both should match the tool character for character.
What a hash is for
Hashes verify integrity. A download page publishes the SHA-256 of an installer so you can confirm the file you received is the one they built. Git identifies commits by hashing their content. Content-addressed caches use the hash of a file as its key so identical files are stored once. A digest inside a signed message proves the body was not altered after signing.
They are not encryption. There is no key and nothing to decrypt; anyone with the same input gets the same output. Publishing the SHA-256 of a secret does not protect the secret if the secret is guessable, because an attacker can hash guesses until one matches.
For that reason plain SHA-256 is the wrong tool for storing passwords. Password hashing needs a deliberately slow, salted function such as Argon2id, scrypt or bcrypt so that guessing millions of candidates per second becomes impractical. Use this generator to check file checksums and debug integrations, not to build a login system.
Choosing an algorithm
SHA-256 is the sensible default and what most protocols, certificates and checksum files use today. SHA-512 is somewhat faster on 64-bit hardware and gives a longer digest; SHA-384 is a truncated variant that avoids length-extension concerns. SHA-1 collisions have been demonstrated in practice, so it should only be used where an older system insists on it, such as legacy Git object IDs.
If you need to authenticate a message with a shared secret rather than merely fingerprint it, you want an HMAC, which combines a hash with a key. That is a different Web Crypto operation and is not offered here.
Learn more
Hashing, encryption and signatures are three distinct primitives that are often confused; information security fundamentals explains what each guarantees and where each belongs. To see a hash-based signature in action, decode a token with the JWT decoder and read securing REST APIs with JWT, which covers how the HS256 and RS256 signatures on those tokens are produced and verified.
FAQ
- Which hash algorithm should I use?
- SHA-256 is a good general-purpose default. SHA-1 is considered cryptographically broken and shouldn't be used for security purposes, though it's still sometimes needed for compatibility with older systems.
- Why isn't MD5 supported?
- MD5 isn't available in the browser's built-in Web Crypto API and is also cryptographically broken — SHA-256 or stronger is recommended instead.
- Is my text uploaded anywhere?
- No. Hashing happens entirely in your browser using crypto.subtle.digest.