What Is a Hash Function?
A cryptographic hash function takes any input — text, file or binary data — and produces a fixed-length string called a hash or digest. The same input always produces the same hash, but even a tiny change in the input (a single character) produces a completely different hash. Hash functions are one-way: you cannot reverse a hash to recover the original data.
Algorithms Supported
| Algorithm | Output Size | Status | Best For |
|---|---|---|---|
| MD5 | 128-bit (32 hex) | Broken | Legacy checksums, non-security use |
| SHA-1 | 160-bit (40 hex) | Deprecated | Git, legacy systems (not for security) |
| SHA-256 | 256-bit (64 hex) | Secure | Passwords, file integrity, TLS, blockchain |
| SHA-384 | 384-bit (96 hex) | Secure | High-security applications |
| SHA-512 | 512-bit (128 hex) | Secure | Maximum security, JWT, HMAC |
Common Use Cases
- Verify file downloads: Publishers provide a hash alongside a download. Hash the file yourself and compare — if they match, the file wasn't tampered with or corrupted.
- Data integrity checks: Detect accidental corruption during transfer or storage.
- Password storage: Never store plaintext passwords — store a salted hash instead. (Use bcrypt, scrypt or Argon2 in production, not plain SHA.)
- Digital signatures: Sign the hash of a document rather than the whole document.
- Deduplication: Identify identical files by comparing hashes instead of full contents.
- Cache busting: Use a file's hash in its URL to force browsers to fetch updated versions.
MD5 vs SHA-1 vs SHA-256 — Which Should You Use?
For security-critical work: Always use SHA-256 or higher. MD5 and SHA-1 have known collision attacks — attackers can craft two different files with the same hash, breaking their security guarantees.
For non-security use (caching, deduplication, checksums): MD5 is fast and fine. But if you're already rewriting code, SHA-256 costs almost nothing on modern CPUs and avoids future migration headaches.
For maximum security (JWTs, HMAC, certificates): SHA-512 is the strongest. Longer output means more work to brute-force, and modern CPUs handle it efficiently.
How to Use This Hash Generator
- Hash Text: Type or paste text. Hashes update live as you type (toggleable). Click any Copy button to grab a single hash, or Copy All for a formatted block.
- Hash File: Drop any file (up to hundreds of MB) and get all five hashes. Hashing runs in chunks so even large files won't freeze your browser.
- Verify Hash: Paste the original text or upload the file, then paste the expected hash. The tool tells you which algorithm produced it.
Pro Tip: When verifying a downloaded file, compare the hash case-insensitively and strip any whitespace. Publishers sometimes format hashes with spaces or uppercase letters — the underlying value is the same.
⚠️ AI-Generated Tool Notice: This Hash Generator was created with the assistance of artificial intelligence. While it uses standard algorithms (Web Crypto API for SHA family, a canonical JS MD5 implementation), you should independently verify the output against a trusted reference tool (like md5sum, sha256sum, or OpenSSL) before using it in any security-sensitive context.