Hash Generator - SHA-1, SHA-256, SHA-384, SHA-512
Generate a cryptographic hash of any text using your browser's built-in Web Crypto API. Nothing you type is sent anywhere - the hash is computed locally.
Maintained by Hirantha Sandaruwan Lakshan. Updated 31 July 2026.
How it works
The text is converted to UTF-8 bytes and passed to SubtleCrypto.digest(), the browser's native hashing implementation, rather than a JavaScript reimplementation of the algorithm.
A hash function always produces the same fixed-length output for the same input, and even a tiny change to the input - a single character - produces a completely different result, which is what makes hashes useful for verifying two pieces of text are identical.
SHA-1 is included for compatibility with older systems but is no longer considered secure against a determined attacker - SHA-256 or higher is recommended for anything security-sensitive.
Worked examples
Verifying two pieces of text are identical
Hash both and compare the output - matching hashes mean the text is byte-for-byte identical.
Generating a checksum for a short string
Paste a value and get its SHA-256 hash for use as a cache key or an identifier derived from content.
Learning how hash functions behave
Try changing a single character in the input and watch the hash output change completely, unlike a checksum that changes proportionally.
Algorithms compared
| Algorithm | Digest size | Hex characters | Status |
|---|---|---|---|
| SHA-1 | 160 bits | 40 | Broken for security - collisions are practical. Legacy checksums only |
| SHA-256 | 256 bits | 64 | The general-purpose default. Widely used and unbroken |
| SHA-384 | 384 bits | 96 | Truncated SHA-512. Used where a longer digest is mandated |
| SHA-512 | 512 bits | 128 | Strongest here, and often faster than SHA-256 on 64-bit hardware |
Frequently asked questions
Is my text uploaded anywhere?
No, hashing happens entirely in your browser tab using the Web Crypto API.
Can I use this to hash a file, not just text?
Not currently - this tool hashes pasted text only.
Is SHA-1 safe to use?
Not for security purposes - practical collision attacks exist against SHA-1. It's included here for compatibility with older systems that still expect it.
Can a hash be reversed back to the original text?
No - a cryptographic hash is a one-way function. There's no way to recover the input from the output alone.
What is a hash actually used for?
Verifying that data hasn't changed. The same input always gives the same digest, so comparing digests tells you whether two files or values are identical without comparing them byte by byte.
Should I use this to hash passwords?
No. Password storage needs a slow, salted algorithm such as bcrypt, scrypt, or Argon2. Plain SHA is deliberately fast, which is exactly what makes it wrong for passwords.
Why does the same text always give the same hash?
That's the defining property of a hash function, and it's what makes verification possible. It also means a hash alone never hides a predictable input.
What is a salt, and does this add one?
A salt is random data mixed in before hashing so identical inputs produce different digests. This tool hashes exactly what you give it, with no salt - it's for checksums, not credential storage.
Sources & references
Updated Jul 31, 2026