Developer Tools · 5 min read
What Is a Hash Function? MD5, SHA-1 & SHA-256 Explained
Hash functions are at the core of modern security — from password storage to file verification and blockchain. Here's how they work.
How a Hash Function Works
A hash function takes any input and produces a fixed-length output called a hash or digest. Key properties:
- Deterministic — the same input always gives the same hash
- One-way — you cannot reverse a hash back to the input
- Avalanche effect — a tiny input change produces a completely different hash
- Fixed output length — regardless of input size
SHA-256("hello") = 2cf24dba5fb0a30e26e83b2ac5b9e29e...
SHA-256("Hello") = 185f8db32921bd46d208b59b79d21e... (completely different!)
Comparing Common Hash Algorithms
| Algorithm | Output Size | Security Status | Use Case |
|---|---|---|---|
| MD5 | 128-bit / 32 chars | ❌ Broken | Checksums only (not security) |
| SHA-1 | 160-bit / 40 chars | ❌ Broken | Legacy systems |
| SHA-256 | 256-bit / 64 chars | ✅ Secure | General security, Bitcoin |
| SHA-512 | 512-bit / 128 chars | ✅ Secure | High-security applications |
| bcrypt / Argon2 | Variable | ✅ Best | Password hashing specifically |
Frequently Asked Questions
A one-way function that converts any input into a fixed-length string. Same input always gives same output; you cannot reverse it.
MD5 (32 chars) and SHA-1 (40 chars) are cryptographically broken and should not be used for security. SHA-256 (64 chars) is the current safe standard.
No. Use bcrypt, scrypt, or Argon2 for passwords. These are deliberately slow to resist brute-force attacks, unlike general-purpose hash functions.
Use PickConverter's free Hash Generator. Enter text and get MD5, SHA-1, SHA-256, and SHA-512 hashes instantly — no sign-up.
Related Articles
#️⃣
Generate hashes instantly — free
MD5, SHA-1, SHA-256, SHA-512. Runs in your browser.
Open Hash Generator →