Hash Generator
Encode text to hashes, decode encodings back, and verify integrity
One-Way Hash
MD5, SHA-1, SHA-256, and SHA-512 are one-way functions. You can hash text but cannot reverse it back. Use the Verify tab to check if a hash matches your text. Switch to Base64 or Hex for reversible encoding.
Algorithm Reference
- MD5 (128-bit) — Fast checksum. Not secure for passwords.
- SHA-1 (160-bit) — Legacy. Deprecated for security use.
- SHA-256 (256-bit) — Industry standard. Used in SSL, Bitcoin, TLS.
- SHA-512 (512-bit) — Strongest. For high-security applications.
- Base64 — Encoding (not a hash). Reversible. Used in emails, URLs, APIs.
- Hex — Encoding (not a hash). Reversible. Represents bytes as 0-9, a-f.
What Is Hashing?
A cryptographic hash function is a mathematical algorithm that converts any input — a word, a document, a file — into a fixed-length string of characters. The output is called a hash or digest. Hash functions have three defining properties: they are deterministic (the same input always produces the same hash), they are one-way (you cannot reverse the hash to get the original input), and they are collision-resistant (two different inputs are astronomically unlikely to produce the same hash).
Hashing vs Encoding: a Critical Distinction
It is important to understand that hashing and encoding are fundamentally different:
- Hashing (MD5, SHA-1, SHA-256, SHA-512): A one-way transformation. You cannot recover the original data from a hash. Used for security — password storage, data integrity, digital signatures.
- Encoding (Base64, Hex): A reversible transformation. The original data can be recovered by decoding. Used for data transmission and representation — NOT for security purposes.
Never use Base64 or Hex for "encrypting" sensitive data — they provide zero security and are trivially reversible.
Algorithm Security Guide
- MD5 (128-bit): Fast, widely supported, but cryptographically broken. Do not use for passwords or security-critical applications. Still useful for non-security checksums and data deduplication.
- SHA-1 (160-bit): Deprecated by NIST and most standards bodies since 2017. Vulnerable to collision attacks. Avoid for any new security application.
- SHA-256 (256-bit): The current gold standard for general security use. Used in TLS/SSL certificates, Bitcoin's blockchain, code signing, and file integrity verification. Part of the SHA-2 family.
- SHA-512 (512-bit): The strongest option here. Used in high-security applications. Internally faster than SHA-256 on 64-bit systems. Suitable when maximum security is required.
Real-World Use Cases
- Password storage: Applications never store passwords in plaintext. Instead, they hash the password (using dedicated password hashing algorithms like bcrypt or Argon2, not MD5/SHA) and store only the hash. At login, the entered password is hashed and compared.
- File integrity verification: Software downloads publish SHA-256 checksums. After downloading, you hash the file yourself and compare — if the hashes match, the file hasn't been tampered with.
- Digital signatures: Cryptographic signatures hash the message, then encrypt the hash with a private key. Anyone with the public key can verify the signature.
- API security: HMAC (Hash-based Message Authentication Code) uses SHA-256 to create authentication tokens in API security (OAuth, AWS Signature, Stripe webhooks).
- Blockchain: Bitcoin and Ethereum link blocks using SHA-256 hashes, making blockchain data tamper-evident.