Hash Generator
MD5, SHA-1, SHA-256, SHA-512
About This Calculator
Cryptographic hash functions produce a fixed-length fingerprint from any input. They are deterministic (same input always gives same output), one-way (cannot reverse), and exhibit the avalanche effect (tiny input change produces completely different hash). Used for password storage, file integrity verification, and digital signatures.
Formula
Input (any size) → Hash function → Fixed-length hex digest
MD5=128 bits (32 hex), SHA-1=160 bits (40 hex), SHA-256=256 bits (64 hex), SHA-512=512 bits (128 hex)
Example Calculation
SHA-256 hash of 'Hello'
- Apply SHA-256 algorithm to bytes of 'Hello'
- Result: 185f8db32921bd46d35cc03f49f6a4d975d6c4e91abef5cf1209fcabc80de69c
64-character hex string (256 bits)
Hash Algorithm Comparison
| Algorithm | Output Bits | Hex Chars | Status |
|---|---|---|---|
| MD5 | 128 | 32 | Broken (collision attacks) |
| SHA-1 | 160 | 40 | Deprecated (weak) |
| SHA-256 | 256 | 64 | Secure (recommended) |
| SHA-512 | 512 | 128 | Secure (high security) |
Frequently Asked Questions
Can a hash be reversed to get the original input?
No. Hash functions are one-way by design. However, common inputs can be found via precomputed rainbow tables. This is why passwords should be hashed with salted algorithms like bcrypt, not plain SHA-256.
What is a hash collision?
A collision occurs when two different inputs produce the same hash output. MD5 and SHA-1 are considered broken because collisions can be deliberately crafted. SHA-256 and SHA-512 have no known practical collision attacks.
Is MD5 safe to use for checksums?
MD5 is still acceptable for non-security file integrity checks (detecting accidental corruption) because collisions require deliberate crafting. However, for any security purpose — password hashing, digital signatures — use SHA-256 or better.
Why does changing one character completely change the hash?
The avalanche effect is a designed property: each bit of input affects every bit of the output. This ensures that even trivial changes produce completely different hashes, making it impossible to guess the input from partial output.