Hash Generator/ MD5 · SHA
Compute MD5, SHA-1, SHA-256, SHA-512 hashes in real-time using the browser's built-in Web Crypto API.
Did this tool solve your problem?
What is a hash algorithm
A hash algorithm is a one-way function that converts input data of any length into a fixed-length output. Common hash algorithms include MD5 (128-bit), SHA-1 (160-bit), SHA-256 (256-bit), and SHA-512 (512-bit). Hashes are deterministic (same input always produces same output), one-way (cannot reverse the hash to get original data), and exhibit the avalanche effect (small input changes cause large output changes).
Common hash use cases
Password storage: systems store hash values (usually salted) instead of plaintext. File integrity: compare SHA-256 hashes after downloading to verify files haven't been tampered with. Digital signatures: sign document hashes to verify source and integrity. Deduplication: use hash values to quickly determine if two pieces of data are identical. Blockchain: Bitcoin uses double SHA-256 hashing to ensure transaction immutability.
Is MD5 still safe to use
MD5 has known collision vulnerabilities (different inputs can produce the same hash), making it unsuitable for security-sensitive applications like password storage or digital signatures. However, MD5 is still widely used in non-security contexts like file checksums and cache key generation. For security-critical applications, use SHA-256 or higher. Our tool supports MD5, SHA-1, SHA-256, and SHA-512 for your convenience.
Code Examples
async function sha256(text) {
const data = new TextEncoder().encode(text);
const hash = await crypto.subtle.digest(
"SHA-256", data
);
return Array.from(new Uint8Array(hash))
.map(b => b.toString(16).padStart(2, "0"))
.join("");
}
await sha256("hello");
// "2cf24dba5fb0a30e26e83b2ac5b9e29e..."import hashlib
text = "hello".encode("utf-8")
print(hashlib.md5(text).hexdigest())
print(hashlib.sha1(text).hexdigest())
print(hashlib.sha256(text).hexdigest())
print(hashlib.sha512(text).hexdigest())
# File hash
with open("file.txt", "rb") as f:
print(hashlib.sha256(f.read()).hexdigest())import (
"crypto/md5"
"crypto/sha256"
"fmt"
)
data := []byte("hello")
md5Hash := md5.Sum(data)
sha256Hash := sha256.Sum256(data)
fmt.Printf("%x\n", md5Hash)
fmt.Printf("%x\n", sha256Hash)# Linux echo -n "hello" | md5sum echo -n "hello" | sha256sum echo -n "hello" | sha512sum # macOS echo -n "hello" | md5 echo -n "hello" | shasum -a 256 # File sha256sum myfile.zip shasum -a 256 myfile.zip