← UserToolbox
🔐 Hash Generator

Free Online Hash Generator (MD5, SHA-1, SHA-256, SHA-512)

Type or paste any text and get MD5, SHA-1, SHA-256, and SHA-512 hashes computed instantly, all at once. 100% in your browser, nothing uploaded.

MD5, SHA-1, SHA-256, SHA-512 — Which Hash Should You Use?

MD5 and SHA-1 are fast and short, which makes them fine for file checksums or cache keys — but both are cryptographically broken and must never be used to store real passwords. SHA-256 is the current standard for security-sensitive hashing (Git commit IDs, JWT signatures, TLS certificates, blockchain). SHA-512 offers extra headroom for long-term integrity checks. This tool computes all four simultaneously so you can compare them side by side.

What Is a Cryptographic Hash Function?

A cryptographic hash function takes any input — a word, a password, an entire file — and deterministically produces a fixed-length output (a "digest") no matter how large the input is. The same input always produces the same output, but even a one-character change in the input flips roughly half the output bits (the "avalanche effect"), and there's no practical way to work backward from the digest to recover the original input (a "one-way" function). These properties make hashes useful for verifying data integrity, detecting duplicates, and building compact identifiers.

哈希生成器

这是一个免费的在线哈希生成器,可同时计算文本的 MD5、SHA-1、SHA-256 和 SHA-512 值。所有计算均在浏览器本地完成,SHA 系列使用 Web Crypto SubtleCrypto API,MD5 使用纯 JavaScript 实现,不会上传任何数据。适用于文件校验、缓存键生成等场景,但请勿用于密码存储——密码请使用 bcrypt 或 Argon2 等专用算法。

Frequently Asked Questions

What's the difference between MD5, SHA-1, SHA-256, and SHA-512, and which should I use?
They're all hash functions that turn input text into a fixed-length fingerprint, but they differ in output length and security. MD5 (128-bit) and SHA-1 (160-bit) are fast and short but cryptographically broken — fine for non-security checksums, but never for anything security-sensitive. SHA-256 (256-bit) is the modern standard for security use: TLS certificates, Git commit IDs, JWTs, blockchain. SHA-512 (512-bit) offers extra headroom for long-term integrity checks. If you're not sure, use SHA-256.
Are MD5 and SHA-1 broken or insecure? Why?
Yes, both are considered cryptographically broken. Researchers have demonstrated practical collision attacks — two different inputs that produce the same hash — against both MD5 and SHA-1, which defeats the core guarantee a security hash is supposed to provide. They're still fine for non-adversarial uses like file checksums or cache keys, but should never be relied on where an attacker could deliberately craft a colliding input.
What should hash functions actually be used for?
Good uses include verifying file integrity (checksums), Git commit IDs, generating deterministic cache keys, and detecting duplicate content. A hash function should NOT be used to store passwords directly — general-purpose hashes like MD5/SHA-256 are designed to be fast, which makes them easy to brute-force. For password storage, use a purpose-built slow hashing algorithm like bcrypt, scrypt, or Argon2 instead.
Is this hash generator safe and private to use?
Yes. Every hash is computed entirely inside your browser. SHA-1, SHA-256, and SHA-512 use the built-in Web Crypto SubtleCrypto API; MD5 (which SubtleCrypto doesn't support) uses a small pure-JavaScript implementation. Nothing you type is uploaded, logged, or transmitted to a server — you can disconnect from the internet after the page loads and it will keep working.
Does this tool work with Unicode or Chinese text?
Yes. Input is encoded as UTF-8 before hashing (via TextEncoder), so Chinese characters, emoji, and any other Unicode text hash correctly and consistently with standard hashing libraries in other languages.
Can I use this to check if a downloaded file matches its published checksum?
This tool hashes text you paste in, not files directly. To verify a downloaded file, compute its hash with a command-line tool (certutil -hashfile on Windows, shasum -a 256 on Mac, sha256sum on Linux) and compare the result against the checksum the publisher provided.

Related Tools

Guides