ad

Hash Generator

Generate MD5, SHA-1, SHA-256, SHA-512 hashes from any text.

What are Cryptographic Hash Functions?

A cryptographic hash function is a mathematical algorithm that maps data of arbitrary size to a fixed-size bit string. Hash functions have three key properties: they are deterministic (same input = same output), fast to compute, and practically irreversible (you cannot recover the input from the hash).

Good hash functions also exhibit the "avalanche effect" — changing a single bit in the input produces a completely different hash. This makes hashes useful for detecting even the smallest changes in data.

Hash Algorithms Compared

  • MD5 — 128-bit (32 hex chars). Fast but cryptographically broken. Use for checksums only.
  • SHA-1 — 160-bit (40 hex chars). Deprecated for security. Google demonstrated a collision in 2017.
  • SHA-256 — 256-bit (64 hex chars). Part of SHA-2 family. Industry standard for security applications, used in Bitcoin and TLS certificates.
  • SHA-512 — 512-bit (128 hex chars). Same family as SHA-256 but with a larger output. Faster on 64-bit processors.

Common Use Cases

  • File integrity — Verify downloads haven't been tampered with
  • Data deduplication — Detect duplicate files by comparing hashes
  • Digital signatures — Sign the hash of a document instead of the entire document
  • Cache keys — Generate deterministic keys for caching systems
  • Git commits — Git uses SHA-1 hashes to identify commits, trees, and blobs

Frequently Asked Questions

What is a hash function?
A hash function takes input data of any size and produces a fixed-size output (the hash or digest). The same input always produces the same hash, but it is computationally infeasible to reverse the hash back to the original input.
Which hash algorithm should I use?
For general checksums, SHA-256 is the recommended choice. MD5 and SHA-1 are cryptographically broken and should not be used for security purposes. For password hashing, use bcrypt, scrypt, or Argon2 — not raw SHA/MD5.
Is MD5 still safe to use?
MD5 is broken for cryptographic purposes — collision attacks are practical. However, MD5 is still acceptable for non-security uses like file checksums, cache keys, and data deduplication where collision resistance is not critical.
Can I reverse a hash to get the original text?
No. Hash functions are one-way by design. You cannot mathematically reverse a hash. However, common passwords can be found via rainbow tables or brute force, which is why passwords should use salted, slow hashing algorithms like bcrypt.
Is my data sent to a server?
No. All hashing is performed in your browser using the Web Crypto API. Your text never leaves your device.
ad