Hash Generator
Generate SHA-1, SHA-256, and SHA-512 hashes from text input.
Note: MD5 is not supported by the Web Crypto API. Use SHA-256 or SHA-512 for secure applications.
Frequently Asked Questions
What is the difference between SHA-1, SHA-256, and SHA-512?
+
SHA-1 produces a 160-bit (40-character hex) digest and is considered cryptographically weak — it should not be used for security purposes. SHA-256 produces a 256-bit (64-character hex) digest and is the current standard for most security applications. SHA-512 produces a 512-bit (128-character hex) digest and is slower but provides a larger safety margin; it can be faster than SHA-256 on 64-bit processors due to its optimized word size.
What is hashing versus encryption?
+
Hashing is a one-way transformation: it converts input data into a fixed-size digest, and there is no key or algorithm to reverse it. Encryption is a two-way transformation: data is converted using a key, and the original data can be recovered using that key (decryption). Use hashing to verify data integrity or store passwords; use encryption when you need to recover the original data later.
Can a hash be reversed to get the original input?
+
In theory, no — hashes are designed to be one-way functions. In practice, short or common inputs can be found via brute-force or rainbow table attacks, which is why passwords should always be hashed with a purpose-built password hashing function (like bcrypt, scrypt, or Argon2) rather than raw SHA. These algorithms add a random salt and are deliberately slow to make attacks impractical.
Why do the same inputs always produce the same hash?
+
Hash functions are deterministic — the same input will always produce the same output. This property is what makes them useful for verifying data integrity: if you hash a file before and after transmission and the hashes match, the file was not altered. Any single bit change in the input produces a completely different hash output (the avalanche effect).
What is a hash collision?
+
A hash collision occurs when two different inputs produce the same hash output. Because hash functions compress arbitrarily large inputs into a fixed-size output, collisions are mathematically inevitable, but a good hash function makes them computationally infeasible to find. SHA-1 has known practical collision attacks (demonstrated by Google's SHAttered attack), which is why SHA-256 or SHA-512 are recommended for new applications.