SHA Hash Generator
Compute cryptographic digests of any text using the browser's Web Crypto API.
Hash versus encryption
A hash is a one-way function: the same input always produces the same fixed-length digest, but you cannot recover the input from the digest. Encryption is reversible with a key. Hashes are for verifying integrity and storing password verifiers; encryption is for keeping data recoverable.
Which algorithm should you use?
- SHA-256 / SHA-512 — the safe default for file checksums, API signatures and general integrity checks.
- SHA-1 — deprecated. Practical collision attacks exist; only included here for checking legacy systems.
- Password storage — do not use any fast SHA hash. Use a deliberately slow, salted algorithm such as bcrypt, scrypt or Argon2id.
Why two identical files hash the same
Hashing is deterministic by design. That is what makes it useful for verifying downloads: if the published SHA-256 and your computed SHA-256 match, the file was not altered in transit. Change a single bit and roughly half the output characters flip, a property called the avalanche effect.
Can two different inputs produce the same hash?
Yes in principle — the input space is infinite and the output space is finite, so collisions must exist. For SHA-256 the search space is so vast that finding one by chance or by brute force is currently considered infeasible.