Hash Generator (SHA-256, SHA-1, SHA-512)
Generate cryptographic hashes of any text using the browser's built-in Web Crypto API. Useful for checksums, cache keys, and understanding how hashing works. Runs locally — your input never leaves the page.
How to use this calculator
- Choose an algorithm — SHA-256 is the modern default.
- Enter the text to hash.
- Press Generate. The same input always produces the same hash; a one-character change transforms it entirely.
Formula used
SHA-256 always outputs 256 bits (64 hex characters) regardless of input size. Good cryptographic hashes are deterministic, fast to compute, infeasible to reverse, and collision-resistant — two different inputs practically never share a hash.
Example calculation
Hello, world! in SHA-256 begins 315f5bdb76d0… (64 hex characters total).
Change it to Hello, World! (capital W) and every character of the hash changes — the avalanche effect that makes hashes useful for detecting any tampering.
What hashing is (and isn't)
A hash is a digital fingerprint: it condenses any input into a fixed-size string, deterministically and irreversibly. That powers file integrity checks (does the download match the published hash?), data structures (hash tables, git commits), and — with salting and slow algorithms — password storage. The avalanche effect means the tiniest change produces a totally different hash, so tampering is instantly detectable.
Two cautions: SHA-1 is broken for security (collisions have been demonstrated) and belongs only in legacy checksums. And plain SHA-256 is wrong for passwords — it's too fast, letting attackers try billions per second; real password storage uses deliberately slow, salted functions like bcrypt, scrypt or Argon2.
Why use this calculator?
- Generate checksums to verify file or text integrity.
- See the avalanche effect and one-way nature of hashing hands-on.
- Produce cache keys or fingerprints — computed locally via Web Crypto.
Frequently asked questions
Can I reverse a hash to get the original text?
No — hashing is one-way by design. Attackers instead guess inputs and compare hashes (dictionary/rainbow-table attacks), which is why passwords need salting and slow algorithms. There's no mathematical 'un-hash' operation.
Which hash algorithm should I use?
SHA-256 for general integrity and fingerprinting. Avoid SHA-1 for anything security-related (it's collision-broken). For passwords specifically, use none of these directly — use bcrypt, scrypt or Argon2, which are intentionally slow and salted.
Why do the same words give the same hash every time?
Determinism is the point — it lets two parties independently verify data matches. It also means identical passwords hash identically, which is exactly why real systems add a unique random salt to each one before hashing.