Hash Generator
Generate SHA-1, SHA-256, SHA-384, and SHA-512 hashes from any text using the Web Crypto API.
Privacy: All calculations run entirely in your browser. No data is sent to any server.
What is a Hash Function?
A hash function takes input of any size and produces a fixed-size output (digest). It's one-way (can't reverse), deterministic (same input = same output), and collision-resistant. Used for data integrity, password storage, digital signatures, and checksums.
Hash Algorithms Compared
SHA-256 is the most widely used (256-bit output, used in TLS, Git, Bitcoin). SHA-1 is deprecated for security (160-bit, still used in legacy systems). SHA-512 offers higher security (512-bit). MD5 is broken for security but still used for checksums.
// Node.js
const crypto = require('crypto');
const hash = crypto.createHash('sha256')
.update('Hello, World!')
.digest('hex');
// Python
import hashlib
hash = hashlib.sha256(b'Hello, World!').hexdigest()
// CLI
echo -n "Hello, World!" | sha256sumCommon Use Cases
- Password storage (hash + salt, use bcrypt/argon2 in production)
- File integrity verification (compare checksums after download)
- Git commits (SHA-1 identifies every commit)
- Digital signatures (hash the message then sign the hash)
- Data deduplication (identify duplicate files by hash)
Frequently Asked Questions
- Can you reverse a hash to get the original text?
- No. Hash functions are one-way by design. You cannot mathematically reverse a hash. However, weak passwords can be found using rainbow tables or brute force — which is why passwords should be hashed with salt using bcrypt or Argon2.
- Is MD5 still safe to use?
- Not for security purposes. MD5 has known collision vulnerabilities. Use SHA-256 or SHA-3 for security. MD5 is still acceptable for non-security checksums like verifying file downloads.
- What's the difference between hashing and encryption?
- Hashing is one-way: you can't recover the original data. Encryption is two-way: data can be decrypted with the correct key. Use hashing for integrity and passwords; use encryption when you need to recover the original data.
Guides
Related Tools
Base64 Encode/Decode
Encode text to Base64 or decode Base64 to text instantly.
JWT DecoderDecode and inspect JSON Web Tokens without sending them to a server.
UUID GeneratorGenerate random UUIDs (v4) in bulk with one click.
TOTP Code GeneratorGenerate time-based one-time passwords from a secret key for debugging 2FA flows.