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

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
MD5128 bits (32 hex)⚠️ BrokenNon-crypto checksums only
SHA-1160 bits (40 hex)⚠️ DeprecatedLegacy systems, Git objects
SHA-256256 bits (64 hex)✅ SecureGeneral-purpose default
SHA-512512 bits (128 hex)✅ SecureHigh-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:

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:

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
DirectionOne-way (irreversible)Two-way (reversible with key)
Key requiredNoYes (symmetric or asymmetric)
OutputFixed-length digestVariable-length ciphertext
GoalVerify integrity / identityProtect confidentiality
ExampleSHA-256, MD5AES-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.

FAQ

Is my data sent to a server?
No. All hashing is done in your browser using the Web Crypto API.
Which hash should I use?
SHA-256 is recommended for most purposes. MD5 and SHA-1 are cryptographically broken.
Can I hash files?
This tool hashes text. For file hashing, use a local tool like sha256sum.
Can a hash be reversed or decrypted?
No. Hash functions are one-way by design — there is no algorithm that reverses a hash back to its input. To "crack" a hash, an attacker must guess inputs (brute force or dictionary attack) and compare the resulting hashes. This is why strong, slow password-hashing algorithms like Argon2id or bcrypt are essential: they make each guess computationally expensive.
Why is SHA-256 recommended over MD5 and SHA-1?
SHA-256 is part of the SHA-2 family and has no known practical collision attacks. MD5 collisions can be generated in under a second, and SHA-1 was broken by the SHAttered attack in 2017. Both are deprecated for any security-sensitive use. SHA-256 provides roughly 128 bits of collision resistance and is the default in TLS, code signing, and blockchain systems.
Is SHA-256 safe for storing passwords?
Raw SHA-256 is fast, which makes it a poor choice for password storage because attackers can try billions of guesses per second. Use a dedicated password-hashing algorithm instead — Argon2id is the current OWASP recommendation, followed by bcrypt, scrypt, or PBKDF2-HMAC-SHA-256. These are deliberately slow and memory-hard to resist GPU and ASIC brute-force attacks.
What is a salt, and do I need one?
A salt is a random value added to the input before hashing so that identical passwords produce different hashes. Salting defeats rainbow tables and ensures that two users with the same password have different stored hashes. Every password hash should use a unique, randomly generated salt.
Are hashes affected by quantum computers?
Grover's algorithm halves the effective security of a hash function, so SHA-256's 128-bit collision resistance drops to ~64 bits and SHA-512's to ~128 bits. SHA-256 is still considered acceptable for the foreseeable future, but for long-term post-quantum security, SHA-384 or SHA-512 provide a larger margin.

Related Tools