Hash Generator
Compute MD5, SHA-1, SHA-256, and SHA-512 hashes instantly in your browser. Paste any text and copy the hex digest. No data leaves your machine.
TL;DR. Paste any text above and all four hash digests update in real time. Use SHA-256 for new work — it is the secure default. MD5 and SHA-1 are shown for legacy compatibility only; both have known collision vulnerabilities. If you need to hash passwords, do not use this tool — use bcrypt or argon2id instead (see FAQ below).
Choosing the right hash algorithm
Not all hash functions are equal. The choice depends on whether you need speed (checksums), collision resistance (digital signatures), or deliberate slowness (passwords). Here is how the four algorithms in this tool compare:
- MD5 (32 hex chars, 128 bits): Fast but cryptographically broken. Two different files can produce the same MD5 hash (a collision attack). Only use it to verify a checksum published by a legacy system that already uses MD5 — never generate new MD5 checksums for security-sensitive files.
- SHA-1 (40 hex chars, 160 bits): Deprecated by NIST in 2011 and practically broken by the SHAttered attack in 2017. Git historically used SHA-1 for commit IDs but is migrating to SHA-256. Avoid SHA-1 for any new application.
- SHA-256 (64 hex chars, 256 bits): The safe default for nearly all use cases today. Used in TLS certificate fingerprints, Bitcoin block headers, Docker image layer IDs, and AWS S3 content hashes. When in doubt, choose SHA-256.
- SHA-512 (128 hex chars, 512 bits): Part of the same SHA-2 family as SHA-256 but with a larger internal state. On 64-bit processors it can actually run faster than SHA-256 because it processes 1024-bit blocks. The main use case is HMAC-SHA512 tokens where you want extra security margin.
Hash algorithms: output lengths and security status
This table covers all common algorithms you will encounter in production systems, including the password-specific hashers that should never be confused with general-purpose hash functions.
| Algorithm | Hex chars | Bits | Security status |
|---|---|---|---|
| MD5 | 32 | 128 | Broken - legacy only |
| SHA-1 | 40 | 160 | Deprecated (NIST 2011) |
| SHA-224 | 56 | 224 | Acceptable, rarely used |
| SHA-256 | 64 | 256 | Safe - recommended default |
| SHA-384 | 96 | 384 | Safe - overkill for most uses |
| SHA-512 | 128 | 512 | Safe - best for HMAC on 64-bit |
| SHA-3 (256) | 64 | 256 | Safe - different construction than SHA-2 |
| BLAKE2b | 128 | 512 | Safe - faster than SHA-512 on modern CPUs |
| BLAKE3 | 64+ | 256+ | Safe - fastest, parallelizable |
| bcrypt | 60 (base64) | N/A | Passwords only - intentionally slow |
| scrypt | variable | N/A | Passwords only - memory-hard |
| argon2id | variable | N/A | Passwords only - OWASP recommended |
Practical examples
- Verify a downloaded file: The publisher posts a SHA-256 checksum next to the download link. After downloading, hash the file and compare the hex strings character by character. Any mismatch means the file was corrupted or tampered with. Tools:
sha256sumon Linux/macOS,Get-FileHashon Windows PowerShell. - Sign an API webhook: GitHub and Stripe sign webhook payloads with HMAC-SHA256 using your secret key. Your server recomputes the HMAC and compares it to the
X-Hub-Signature-256header. Use a constant-time comparison function to prevent timing attacks. - Deduplicate file storage: Hash every uploaded file with SHA-256 and use the digest as the storage key. Files with identical content get the same key, so you only store each unique file once. This is how content-addressable storage (Git objects, IPFS, Docker layers) works.
- Build an etag for HTTP caching: Hash the response body with SHA-256 (or MD5 for lightweight cases). Send the digest as the
ETagheader. On subsequent requests, if the client sends the same etag inIf-None-Matchand the content has not changed, return 304 Not Modified. - Generate a cache-busting fingerprint: Hash a CSS or JS bundle and append the first 8 hex chars to the filename:
app.a1b2c3d4.js. CDNs and browsers treat this as a new file, so users always get the latest version without a hard refresh.
Security warning: never use these for password storage. MD5, SHA-1, SHA-256, and SHA-512 are designed to be fast. An attacker with a modern GPU can compute billions of SHA-256 hashes per second. A 10-character password hashed with raw SHA-256 can be cracked in minutes. For passwords, always use a purpose-built slow hash: argon2id (OWASP top recommendation), bcrypt (the established standard), or scrypt (memory-hard). These functions include automatic salting and are intentionally slow to resist brute force.
Frequently asked questions
What is a hash function and what is it used for?+
Which algorithm should I choose: MD5, SHA-1, SHA-256, or SHA-512?+
Can I use this tool to hash passwords for storage in a database?+
What is a salt and why does it matter?+
What is HMAC and when should I use it instead of a plain hash?+
Does this tool send my data to a server?+
Related security tools
- Password Generator
Generate strong random passwords with entropy scoring
- UUID Generator
Generate RFC 4122 UUIDs v1 and v4
- Base64 Converter
Encode and decode Base64 strings
- Regex Tester
Test and debug JavaScript regular expressions live