Generate SHA-1, SHA-256, SHA-384, and SHA-512 hashes from any text. Shows all four algorithms at once in hex or Base64 — powered by the Web Crypto API.
Enter text and generate hashes
A cryptographic hash function is a mathematical algorithm that maps arbitrary-length binary input data to a fixed-size bit string digest. Designed to be irreversible one-way functions, cryptographic hashes form the foundation of digital signatures, password storage verification, Git commit histories, and blockchain ledgers.
| Algorithm | Output Digest Length | Collision Resistance | Status / Recommended Application |
|---|---|---|---|
| MD5 | 128 bits (32 hex characters) | Vulnerable / Broken | Non-cryptographic checksums against accidental disk corruption only |
| SHA-1 | 160 bits (40 hex characters) | Vulnerable / Broken | Formally deprecated by NIST; legacy Git object commit IDs |
| SHA-256 | 256 bits (64 hex characters) | Cryptographically Secure | Current industry standard for TLS/SSL, Bitcoin, and file verification |
| SHA-512 | 512 bits (128 hex characters) | Cryptographically Secure | High-security enterprise systems; optimized for 64-bit CPU architectures |
JavaScript (Web Crypto API)
async function calculateHash(message, algorithm = 'SHA-256') {
const msgUint8 = new TextEncoder().encode(message);
const hashBuffer = await crypto.subtle.digest(algorithm, msgUint8);
const hashArray = Array.from(new Uint8Array(hashBuffer));
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
}
calculateHash("BestToolOnline").then(console.log);
Python (hashlib)
import hashlib
data = "BestToolOnline".encode("utf-8")
sha256_hash = hashlib.sha256(data).hexdigest()
sha512_hash = hashlib.sha512(data).hexdigest()
print("SHA-256:", sha256_hash)
print("SHA-512:", sha512_hash)
This website and utility are provided for general informational, calculation, and educational purposes only. Always verify critical computation outputs prior to professional deployment or financial use. See our Terms of Service and Privacy Policy for full governance details.