What is Hash Function?

A hash function maps input data of any size to a fixed-size string (the hash or digest). Good cryptographic hashes are deterministic, fast, and one-way — you cannot feasibly reverse the digest back to the input.

Hashes are used for integrity checks, deduplication, and (with salting) password storage. Common algorithms include SHA-256 and SHA-512; MD5 and SHA-1 are now considered insecure for cryptographic use.

Key points

  • A hash maps any input to a fixed-length digest and cannot be reversed.
  • The same input always produces the same hash (deterministic).
  • A tiny input change produces a completely different digest (avalanche effect).
  • Secure hashes resist collisions; MD5 and SHA-1 no longer do.

Example

sha256("hello") =
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

Common uses

  • Verifying file integrity with checksums
  • Deduplicating data by comparing digests
  • Storing passwords (with a slow, salted algorithm)
  • Building digital signatures and HMACs

Work with Hash Function directly in your browser.

Open the Hash Generator

More terms