Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes of any text instantly.
About Hash Functions
A hash function is a one-way mathematical algorithm that converts input data of any size — a single letter, a paragraph, or a multi-gigabyte file — into a fixed-length string of characters called a hash, digest, or checksum. The same input always produces the same output, but even a tiny change to the input (a single flipped bit) produces a completely different hash. This property makes a hash generator invaluable for verifying data integrity, storing credentials safely, and building cryptographic systems.
This free online hash generator runs entirely in your browser using the Web Crypto API, so your text never leaves your device. It supports the most widely used algorithms — MD5, SHA-1, SHA-256, SHA-384, and SHA-512 — and is perfect for developers, security researchers, and anyone who needs to compute a digest quickly.
Key Properties of a Cryptographic Hash
- Deterministic: The same input always yields the same hash.
- Fixed output length: No matter how large the input, the hash has a constant length (e.g. 64 hex characters for SHA-256).
- Avalanche effect: A one-bit change in the input changes roughly half the output bits.
- One-way (preimage resistant): It is computationally infeasible to reverse the hash back to the original input.
- Collision resistant: It should be extremely hard to find two different inputs that produce the same hash.
- Fast to compute: A hash generator can process megabytes of data in milliseconds.
Hash Types: MD5, SHA-1, SHA-256, and SHA-512 Compared
Not all hash algorithms are created equal. They differ in output length, speed, and — most importantly — security. The table and sections below break down the four most common algorithms you'll encounter when using a hash generator.
| Algorithm |
Output length |
Security status |
Typical use today |
| MD5 | 128 bits (32 hex) | ⚠️ Broken | Non-crypto checksums only |
| SHA-1 | 160 bits (40 hex) | ⚠️ Deprecated | Legacy systems, Git objects |
| SHA-256 | 256 bits (64 hex) | ✅ Secure | General-purpose default |
| SHA-512 | 512 bits (128 hex) | ✅ Secure | High-security, 64-bit systems |
MD5 (Message Digest 5)
MD5, designed in 1991, produces a 128-bit hash. It is fast and compact, which made it popular for file checksums and legacy password storage. However, MD5 is cryptographically broken: researchers have demonstrated practical collision attacks, meaning two different inputs can be crafted to share the same MD5 hash. Because of this, MD5 must never be used for password hashing, digital signatures, or any security-sensitive purpose. It remains acceptable only as a quick, non-security checksum for detecting accidental data corruption.
SHA-1 (Secure Hash Algorithm 1)
SHA-1 outputs a 160-bit digest and was widely deployed in TLS certificates, Git, and PGP through the 2000s. In 2017, Google and CWI Amsterdam published the SHAttered attack — the first practical collision for SHA-1. All major browsers and certificate authorities have since deprecated SHA-1, and NIST formally disallowed it for digital signatures after 2013. Like MD5, avoid SHA-1 for any new security work; it still appears in legacy systems and Git's object model, where collision risk is mitigated by trust models.
SHA-256
SHA-256 is part of the SHA-2 family (defined in FIPS 180-4) and is the recommended default for almost every modern application. It produces a 256-bit hash, has no known practical attacks, and is used by Bitcoin, TLS 1.3, SSH, code-signing certificates, and countless file-integrity tools. For most uses of a hash generator — verifying downloads, building Merkle trees, or generating identifiers — SHA-256 is the right choice. For password storage, pair it with a slow key-derivation function such as Argon2, bcrypt, or PBKDF2 rather than hashing passwords directly.
SHA-512
SHA-512 produces a 512-bit digest and is designed to run efficiently on 64-bit processors, often outperforming SHA-256 in raw throughput on modern hardware. It offers a larger security margin and is preferred for high-security contexts, HMAC construction on 64-bit systems, and applications that can afford the longer digest. SHA-512/256 (a truncated variant) gives you SHA-512's speed with a 256-bit output if length is a concern.
SHA-384
SHA-384 is also part of the SHA-2 family and is essentially SHA-512 with a different initial value, truncated to 384 bits. It matches SHA-512's performance characteristics and is commonly used in ECDSA and X.509 certificates where a 384-bit security level is desired.
Collision Resistance Explained
Collision resistance is the property that makes it infeasible to find two distinct inputs that hash to the same value. It is the cornerstone of a hash function's security guarantees. By the birthday paradox, a hash with n bits of output has a collision resistance strength of roughly n/2 bits — so SHA-256 provides about 128 bits of collision resistance, and SHA-512 about 256 bits.
When a collision attack becomes practical, the algorithm is considered broken:
- MD5 collisions can be generated in under a second on a standard laptop.
- SHA-1 collisions cost roughly $110k in cloud compute (SHAttered, 2017) and have only gotten cheaper.
- SHA-256 / SHA-512 have no known practical collision attacks and are expected to remain secure for decades — until large-scale quantum computers threaten them via Grover's algorithm, which halves their effective strength.
For any system that relies on a hash being unique — content-addressable storage, digital signatures, blockchains, certificate fingerprints — collision resistance is non-negotiable. Always choose SHA-256 or stronger.
When to Use Which Hash Algorithm
Choosing the right algorithm depends on your goal. Here are practical recommendations:
- Verifying file downloads / integrity checks: SHA-256 is the modern standard. Most Linux distributions and software vendors publish SHA-256 checksums.
- Password storage: Do not hash passwords directly with SHA-256. Use a dedicated password hashing algorithm — Argon2id (the OWASP recommendation), bcrypt, or scrypt — which are deliberately slow and memory-hard to resist brute force. PBKDF2-HMAC-SHA-256 is acceptable when Argon2 is unavailable.
- Digital signatures & certificates: SHA-256 or SHA-384 with RSA/ECDSA. SHA-1 signatures are rejected by all modern browsers.
- Blockchain & cryptocurrencies: Bitcoin uses SHA-256 (double-hashed); Ethereum uses Keccak-256; Litecoin uses Scrypt. Each chain specifies its own algorithm.
- Content-addressable storage / Git: Git uses SHA-1 historically and is migrating to SHA-256. IPFS uses SHA-2-256 by default.
- HMAC / message authentication: HMAC-SHA-256 is the ubiquitous choice for API signing and JWT integrity.
- Quick non-security checksums: MD5 or CRC32 are fine when you only need to detect accidental corruption and have no adversarial threat.
If you're unsure, default to SHA-256 — it's the safe, well-supported choice for the vast majority of hash generator use cases.
Common Use Cases for a Hash Generator
1. Password Storage
Never store user passwords in plaintext. Instead, store a salted hash produced by a slow, memory-hard algorithm. When a user logs in, the system hashes the submitted password with the same salt and compares the result. A hash generator can help you understand what these digests look like, but for production password storage use Argon2id, bcrypt, or PBKDF2 — never raw SHA-256 or MD5.
2. File Integrity & Verification
Software distributors publish checksums so you can confirm a download wasn't corrupted or tampered with. Running sha256sum on a file and comparing the output to the published SHA-256 hash guarantees byte-for-byte integrity. This protects against both accidental corruption (network errors) and intentional tampering (supply-chain attacks), provided you obtained the checksum over a trusted channel.
3. Digital Signatures
Digital signature schemes like RSA-PSS and ECDSA don't sign the document directly — they sign a hash of the document. The signer runs the message through a hash generator (SHA-256 or stronger), then encrypts the digest with their private key. Because collision-resistant hashes make it infeasible to forge a different document with the same digest, the signature is bound to the exact content.
4. Blockchain & Cryptocurrencies
Blockchains are built on hashing. Bitcoin hashes block headers with SHA-256 as part of its proof-of-work, links blocks by including the previous block's hash, and addresses accounts via hashes of public keys. Merkle trees — which efficiently summarize large datasets using hashes — are fundamental to how nodes verify transactions without downloading the entire chain.
5. Data Deduplication & Content Addressing
Systems like Git, IPFS, and many backup tools identify objects by their hash. Two identical files produce the same hash, so storage can be deduplicated automatically. This is also how content-addressable networks route requests.
6. HMAC & API Request Signing
REST APIs and JWTs use HMAC (Hash-based Message Authentication Code) to prove that a request wasn't tampered with. HMAC-SHA-256 combines a secret key with the message and runs it through the hash function, producing a tag that only someone with the key can generate or verify.
Hashing vs. Encryption: What's the Difference?
Hashing and encryption are both cryptographic operations, but they serve fundamentally different purposes — and confusing them is a common security mistake.
| Feature |
Hashing |
Encryption |
| Direction | One-way (irreversible) | Two-way (reversible with key) |
| Key required | No | Yes (symmetric or asymmetric) |
| Output | Fixed-length digest | Variable-length ciphertext |
| Goal | Verify integrity / identity | Protect confidentiality |
| Example | SHA-256, MD5 | AES-256, RSA, ChaCha20 |
You cannot "decrypt" a hash. A hash generator produces a one-way fingerprint — there is no algorithm that reverses it. To "crack" a hash you must guess inputs (a brute-force or dictionary attack) and check whether they produce the same digest. This is exactly why hashing is appropriate for password storage (the server never needs to know the original password) while encryption is appropriate for data you must later recover, like messages or files.
Modern systems often combine both: encrypt data for confidentiality, and hash it (or use an HMAC) to verify integrity and authenticity.