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.

Result

How to use this calculator

  1. Choose an algorithm — SHA-256 is the modern default.
  2. Enter the text to hash.
  3. Press Generate. The same input always produces the same hash; a one-character change transforms it entirely.

Formula used

Hash = one-way function mapping any input to a fixed-length digest

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

Worked example

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?

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.

Related calculators