Dev ToolsMarch 30, 2026

Hash Generator Guide: MD5, SHA-256, SHA-512 & More Explained

By The hakaru Team·Last updated March 2026

Quick Answer

  • *A hash function converts any input into a fixed-size string that acts as a unique fingerprint for the data.
  • *SHA-256 is the most widely used secure hash today — it powers Bitcoin, TLS certificates, and Git commit integrity.
  • *MD5 and SHA-1 are broken for security purposes but still fine for checksums and deduplication.
  • *For password hashing, use bcrypt or Argon2 — never raw SHA-256 or MD5.

What Is a Hash Function?

A hash function takes input data of any size — a single character, a 10GB file, anything — and produces a fixed-size output called a digest. The same input always produces the same digest. Change even one bit of the input, and the output changes completely.

This property is called the avalanche effect. For example, the SHA-256 hash of “hello” and “Hello” (one capital letter difference) share zero resemblance in their outputs. That unpredictability is what makes hash functions useful for verifying data integrity.

Hash Algorithms Compared

Not all hash functions are created equal. Here's how the most common algorithms compare:

AlgorithmOutput SizeSpeedSecurity Status
MD5128 bits (32 hex chars)Very fastBroken (collisions since 2004)
SHA-1160 bits (40 hex chars)FastBroken (SHAttered attack, 2017)
SHA-256256 bits (64 hex chars)FastSecure
SHA-384384 bits (96 hex chars)FastSecure
SHA-512512 bits (128 hex chars)Fast (faster on 64-bit CPUs)Secure
SHA-3 (Keccak)224–512 bitsModerateSecure (different design from SHA-2)
BLAKE3256 bits (variable)Very fastSecure (newest, parallelizable)

According to NIST Special Publication 800-131A (updated 2024), SHA-1 is disallowed for digital signatures and SHA-256 or higher is required for federal information systems. Most of the tech industry follows this guidance.

MD5: Fast but Broken

MD5 was designed by Ronald Rivest in 1991 and produces a 128-bit hash. It was the default checksum algorithm for decades. Then in 2004, Chinese researcher Xiaoyun Wang demonstrated the first practical MD5 collision — two different inputs producing the same hash.

In 2008, researchers used an MD5 collision to create a fraudulent Certificate Authority certificate, proving the vulnerability had real-world consequences. By 2025, generating an MD5 collision takes seconds on commodity hardware.

MD5 is still acceptable for non-security uses: verifying file downloads, data deduplication, and cache keys where an attacker can't exploit collisions. But for anything involving trust or authentication, use SHA-256 or better.

SHA-256: The Current Standard

SHA-256 is part of the SHA-2 family, designed by the NSA and published by NIST in 2001. It produces a 256-bit (32-byte) digest represented as 64 hexadecimal characters.

SHA-256's reach is enormous:

  • Bitcoin: The entire Bitcoin blockchain uses SHA-256 for proof-of-work mining and transaction verification. As of 2025, the Bitcoin network computes roughly 600 exahashes per second — that's 600 × 10^18 SHA-256 operations every second.
  • TLS/SSL: Over 99% of HTTPS certificates use SHA-256 for their signature hash, according to SSL Labs' 2025 survey.
  • Git: Git uses SHA-1 for commit hashes by default but has been transitioning to SHA-256 since Git 2.29 (2020). GitHub enabled SHA-256 repositories in 2024.
  • Package managers: npm, PyPI, Docker Hub, and most Linux package repositories use SHA-256 checksums for integrity verification.

No practical collision or preimage attack against SHA-256 has been demonstrated. Breaking it would require approximately 2^128 operations for a collision — a number so large that all the world's computing power running for billions of years wouldn't get close.

SHA-512: When You Want a Larger Margin

SHA-512 uses the same fundamental structure as SHA-256 but operates on 64-bit words instead of 32-bit words, producing a 512-bit (64-byte) output. Counterintuitively, SHA-512 is often faster than SHA-256 on modern 64-bit processorsbecause the arithmetic maps directly to the CPU's native word size.

According to OpenSSL benchmarks on an AMD EPYC 7763 processor, SHA-512 achieves roughly 750 MB/scompared to SHA-256's 550 MB/s on the same hardware. SHA-512 is commonly used in enterprise systems, government applications, and protocols that want a larger security margin against future quantum computing advances.

Common Use Cases for Hash Functions

File Integrity Verification

When you download software, the publisher often provides a SHA-256 checksum. You hash the downloaded file locally and compare. If the hashes match, the file wasn't corrupted or tampered with during transfer. ISO image downloads, firmware updates, and open-source packages all use this pattern.

Data Deduplication

Cloud storage systems like Dropbox and Google Drive hash file blocks to identify duplicates. According to a 2023 study published in ACM Computing Surveys, data deduplication using content-defined chunking with SHA-256 hashing reduces storage requirements by 50–70% on average for enterprise backup systems.

Digital Signatures

Digital signatures don't sign the entire document — they sign its hash. This is faster (hashing a 100MB file produces a fixed 32-byte digest to sign) and enables fixed-size signatures regardless of document length. ECDSA, RSA, and EdDSA all hash the message before signing.

Content-Addressable Storage

Systems like Git, IPFS, and Docker use hashes as addresses for content. A Git commit ID is the SHA-1 hash of the commit object. A Docker image layer is addressed by its SHA-256 digest. This means the same content always has the same address — content integrity is built into the addressing scheme.

Password Hashing: A Special Case

Using raw SHA-256 for passwords is a common mistake. General-purpose hash functions are designed to be fast — a modern GPU can compute billions of SHA-256 hashes per second. An attacker with a leaked password database can brute-force common passwords almost instantly.

Password-specific hash functions solve this by being intentionally slow:

AlgorithmDesigned ForKey Feature
bcryptPassword hashingConfigurable work factor (cost parameter)
Argon2Password hashingMemory-hard (resists GPU attacks)
scryptPassword hashingMemory-hard + CPU-hard
PBKDF2Key derivationIteration count (NIST approved)

OWASP's 2025 Password Storage Cheat Sheet recommends Argon2id as the first choice, bcrypt as the second, and scrypt as the third. Raw SHA-256 or MD5 should never be used for passwords.

Quantum Computing and Hash Functions

Grover's algorithm theoretically halves the security level of hash functions on a quantum computer. SHA-256's 128-bit collision resistance would drop to 85 bits — still extremely difficult to attack but below the 128-bit threshold many standards require.

NIST's post-quantum cryptography standardization (finalized 2024) recommends SHA-384 or SHA-512 for applications requiring long-term quantum resistance. SHA-3 is also considered quantum-resistant at appropriate output sizes because its sponge construction provides different security properties than SHA-2's Merkle-Damgård structure.

Generate MD5, SHA-256, and SHA-512 hashes instantly

Use our free Hash Generator →

Frequently Asked Questions

What is a hash function?

A hash function takes input data of any size and produces a fixed-size output string called a digest. The same input always produces the same output, but even a tiny change in the input completely changes the hash. Hash functions are one-way — you cannot reverse a hash back to the original input.

Is MD5 still safe to use?

MD5 is not safe for security-critical applications like password hashing or digital signatures. Researchers demonstrated practical collision attacks against MD5 as early as 2004. However, MD5 is still acceptable for non-security uses like file checksums and deduplication where collision resistance is not critical.

What is the difference between SHA-256 and SHA-512?

SHA-256 produces a 256-bit (32-byte) hash and SHA-512 produces a 512-bit (64-byte) hash. SHA-512 offers a larger security margin against brute-force attacks and is actually faster than SHA-256 on 64-bit processors because it uses 64-bit arithmetic natively. Both are part of the SHA-2 family and are considered cryptographically secure.

Should I use SHA-256 or bcrypt for password hashing?

Use bcrypt (or Argon2, scrypt) for password hashing — never raw SHA-256. General-purpose hash functions like SHA-256 are designed to be fast, which makes them vulnerable to brute-force attacks on passwords. Password hashing algorithms like bcrypt are intentionally slow and include a configurable work factor.

Can two different inputs produce the same hash?

Theoretically yes — this is called a collision. Since hash functions map infinite possible inputs to a fixed-size output, collisions must exist mathematically. For secure algorithms like SHA-256, finding a collision would require approximately 2^128 operations, which is computationally infeasible with current technology.