Hash Generator
Generate cryptographic hashes using MD5, SHA-1, SHA-256, and SHA-512 algorithms. Useful for checksums, data integrity, and understanding password hashing.
MD5
Enter text above to generate hash128-bit (32 hex chars) - Not recommended for security
SHA-1
Enter text above to generate hash160-bit (40 hex chars) - Deprecated for security
SHA-256
Enter text above to generate hash256-bit (64 hex chars) - Recommended
SHA-512
Enter text above to generate hash512-bit (128 hex chars) - High security
Password Hashing with bcrypt
For password storage, use bcrypt, Argon2, or scrypt - NOT MD5/SHA. These algorithms are intentionally slow and include salting.
Node.js
const bcrypt = require('bcrypt');
// Hash a password
const hash = await bcrypt.hash('password', 10);
// $2b$10$N9qo8uLOickgx2ZMRZoMye...
// Verify a password
const isValid = await bcrypt.compare('password', hash);Important: Hash vs Encryption
- Hashing is one-way - you cannot recover the original text from a hash
- MD5 and SHA-1 are broken - don't use for security purposes
- Never store plain SHA hashes of passwords - use bcrypt/Argon2 instead
- Hashes are deterministic - same input always produces same output
Common Use Cases
File Checksums
Verify file integrity after downloads. SHA-256 is the standard for software verification.
Data Deduplication
Identify duplicate content by comparing hashes instead of full content.
Digital Signatures
Sign a hash of a document instead of the entire document for efficiency.
Caching Keys
Generate unique cache keys from request parameters or content.
Generate Hashes in Terminal
macOS / Linux
# MD5
echo -n "text" | md5sum
# or on macOS:
echo -n "text" | md5
# SHA-256
echo -n "text" | sha256sum
# SHA-512
echo -n "text" | sha512sum
# File hash
sha256sum filename.txtPython
import hashlib
text = "text"
print(hashlib.sha256(text.encode()).hexdigest())