# Hash Generator - SHA-1, SHA-256, SHA-384, SHA-512

Page: https://hirantha.me/tools/hash-generator
Part of: Hirantha Sandaruwan Lakshan free tools (https://hirantha.me/tools)
Updated: 2026-07-31

Generate a SHA-1, SHA-256, SHA-384, or SHA-512 hash of text.

This is a free tool that runs in the browser: open the page to use it. File tools process files on the visitor's own device; files are never uploaded or stored. No account, sign-up, payment or watermark.

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.

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.

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 |

Q: Is my text uploaded anywhere?
A: No, hashing happens entirely in your browser tab using the Web Crypto API.

Q: Can I use this to hash a file, not just text?
A: Not currently - this tool hashes pasted text only.

Q: Is SHA-1 safe to use?
A: Not for security purposes - practical collision attacks exist against SHA-1. It's included here for compatibility with older systems that still expect it.

Q: Can a hash be reversed back to the original text?
A: No - a cryptographic hash is a one-way function. There's no way to recover the input from the output alone.

Q: What is a hash actually used for?
A: 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.

Q: Should I use this to hash passwords?
A: 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.

Q: Why does the same text always give the same hash?
A: 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.

Q: What is a salt, and does this add one?
A: 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: SubtleCrypto: digest() method - MDN (https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest); Secure Hash Algorithms - Wikipedia (https://en.wikipedia.org/wiki/Secure_Hash_Algorithms)

Related tools:

- [Base64 encode & decode](https://hirantha.me/tools/base64.md): Convert text to Base64 and back, right in your browser.
- [UUID generator](https://hirantha.me/tools/uuid-generator.md): Generate random version 4 UUIDs, one at a time or in bulk.
- [Password strength checker](https://hirantha.me/tools/password-strength-checker.md): Test a password in your browser: guess estimate, patterns found, crack times at stated speeds and a random passphrase maker. Nothing is sent anywhere.
- [Random number generator](https://hirantha.me/tools/random-number-generator.md): Pick random whole numbers or decimals in any range, with or without repeats, drawn fairly from your browser's secure random number generator.
