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.

Input Text
MD5
SHA-1
SHA-256
SHA-512

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

JavaScript (Web Crypto API)
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..."
Python (hashlib)
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())
Go (crypto)
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)
Shell
# 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

Frequently Asked Questions

What is a hash function?
A hash function maps input data of any length to a fixed-length output (digest). The same input always produces the same hash; different inputs almost never collide (collision resistance); and the input cannot be reconstructed from the hash (one-way property).
Is MD5 still secure?
MD5 is no longer secure for passwords or digital signatures — known collision attacks exist. It's still widely used for non-security purposes like file integrity checks and checksums. For passwords in production, use bcrypt or Argon2.
What's the difference between SHA-256 and SHA-512?
Both are part of the SHA-2 family with sufficient security. SHA-256 produces a 32-byte (256-bit) digest; SHA-512 produces 64 bytes (512 bits). SHA-512 is faster on 64-bit CPUs; SHA-256 is faster on 32-bit systems. Bitcoin uses SHA-256; Git uses SHA-1 (migrating to SHA-256).
Does the same hash mean the same content?
Practically, yes. Hash collisions (two different inputs producing the same hash) are computationally infeasible for SHA-256 and SHA-512. Verifying a file's SHA-256 after download confirms it hasn't been tampered with or corrupted.
How do I compute hashes in the terminal?
Linux: md5sum file.txt / sha256sum file.txt / sha512sum file.txt. macOS: md5 file.txt / shasum -a 256 file.txt / shasum -a 512 file.txt. Windows PowerShell: Get-FileHash file.txt -Algorithm SHA256.
Is my data safe?
Yes. This tool runs entirely in your browser — MD5 is implemented in pure JavaScript, and SHA hashes use the browser's built-in Web Crypto API. No data is ever sent to any server.