Guide

MD5 vs SHA-256 vs SHA-3 vs BLAKE2: Which Hash to Use

Short answer: in the MD5 vs SHA-256 decision, use SHA-256 (or SHA-512) for integrity checks and signatures. Use SHA-3 or BLAKE2 when you have a specific reason. Treat MD5 and SHA-1 as legacy: fine for spotting accidental corruption, unsafe for anything an attacker could tamper with. Never use any plain hash to store passwords.

You can try every algorithm below in the Hash Generator, which runs entirely in your browser.

What a hash function does

A hash function turns any input into a short, fixed-length fingerprint. The same input always gives the same output, and changing a single character produces a completely different result. That makes hashes useful for three jobs: checking that a download was not corrupted, detecting changes in data, and identifying content.

A cryptographic hash adds a security promise: nobody should be able to find two different inputs with the same hash (a collision), or build an input that matches a given hash. When that promise breaks, the algorithm is called broken for security use, even though it still produces a hash.

Why the choice matters

Picking the wrong algorithm rarely breaks things on day one. It breaks later, when someone crafts a malicious file that has the same hash as a harmless one and your checksum cannot tell them apart. That is exactly what a collision attack makes possible against MD5 and SHA-1.

The algorithms at a glance

Algorithm Output Status Good for Avoid for
MD5 128 bits Broken (collisions are easy to create) Non-security checksums, legacy systems Signatures, certificates, anything an attacker can influence
SHA-1 160 bits Broken (practical collision shown in 2017, the "SHAttered" attack) Legacy compatibility (older Git data, old systems) New security designs
SHA-256 / SHA-384 / SHA-512 256 / 384 / 512 bits Secure (SHA-2 family) Integrity checks, signatures, HMAC, most general use Password storage on its own
SHA3-224 / 256 / 384 / 512 224–512 bits Secure (NIST FIPS 202, Keccak) Systems that want a different design from SHA-2 Confusing with "keccak256" (see below)
BLAKE2b / BLAKE2s up to 512 / 256 bits Secure, fast (RFC 7693) Fast hashing of large data, modern tools Places that require a NIST-approved algorithm
CRC-32, CRC-32C, Adler-32 32 bits Not cryptographic Catching accidental damage in transit or storage Proving data is genuine

MD5 and SHA-1: broken, but not useless

Researchers can create two different files with the same MD5 hash, and a practical SHA-1 collision was published in 2017. So you should not use either to verify that a file is authentic. They are still everywhere for non-security purposes: cache keys, de-duplication, and old package indexes. If a publisher only gives an MD5 sum, comparing it still catches a broken download. It does not protect you from a malicious one.

SHA-256 and the SHA-2 family: the default

SHA-256, SHA-384 and SHA-512 are the safe, widely supported choices. SHA-256 is what most TLS certificates, software signatures and package managers rely on. If you do not have a reason to choose something else, choose SHA-256.

One subtlety: SHA-2 hashes are vulnerable to length extension if you misuse them as a keyed hash (SHA256(secret + message)). The fix is not a different algorithm but the right construction: HMAC (see HMAC vs hash and how to verify a webhook signature). The Hash Generator can compute an HMAC when you enter a secret key.

SHA-3: a different design, not a replacement

SHA-3 is standardised in NIST FIPS 202 and is built on the Keccak sponge construction, which is structurally different from SHA-2. It was chosen as a backup in case SHA-2 weaknesses were ever found, not because SHA-2 is broken. Careful: the "keccak256" function used by some blockchains is not the same as NIST SHA3-256, because the padding differs. The two give different outputs for the same input.

BLAKE2: fast and modern

BLAKE2b and BLAKE2s (RFC 7693) are designed to be fast in software while staying secure. They are popular in tools where speed on large files matters. In the Hash Generator, only the unkeyed, default-length forms are offered (BLAKE2b-512 and BLAKE2s-256).

CRC-32, CRC-32C and Adler-32: checksums, not security

These catch accidental damage such as a flipped bit. Anyone can deliberately craft data that has a chosen CRC, so never use them to prove that data is genuine.

How to choose

  1. Checking a download against a publisher's checksum: use whatever the publisher lists, but prefer SHA-256 if you have the choice.
  2. Digital signatures, certificates, tamper detection: SHA-256 or SHA-384/512.
  3. Authenticating a message with a shared secret: HMAC-SHA-256 (see the HMAC tool).
  4. Hashing very large files quickly: BLAKE2, if both sides support it.
  5. Storing passwords: none of the above. Use Argon2id, scrypt or bcrypt (and see how long a random password should be), as the OWASP Password Storage Cheat Sheet recommends. If you must use PBKDF2, use a high iteration count (OWASP's current figures are 600,000 for HMAC-SHA-256 and 220,000 for HMAC-SHA-512).
  6. Detecting accidental corruption only: CRC-32, Adler-32, or even MD5 is fine.

How to check MD5 vs SHA-256 hashes with the Hash Generator

  1. Open the Hash Generator.
  2. Hash text: paste or type it into the text box. MD5, SHA-1, SHA-256, SHA-384 and SHA-512 results appear. Tick "Uppercase hex" if you need capital letters.
  3. Hash a file: choose a file (up to 200 MB). It is read locally and never uploaded.
  4. Verify a download: paste the publisher's checksum into "Compare with an expected hash". Case, spaces, colons and a leading 0x are ignored, and every hash on the page is checked. A match means your file is byte-for-byte identical to what the publisher hashed.
  5. More algorithms: open "More algorithms" and choose SHA3-224/256/384/512, BLAKE2b-512, BLAKE2s-256, CRC-32, CRC-32C or Adler-32, then press Compute. These run in a background worker and are slower than SHA-256: expect roughly 10 to 60 MB per second, so a 200 MB file can take several seconds per algorithm.
  6. HMAC: choose an algorithm, enter a secret key, and read the HMAC result.
  7. Check a whole checksum file: use "Verify a checksum file" with a sha256sum, md5sum or BSD-style file, then select the files it lists.
  8. Derive a key: the PBKDF2 section uses your browser's WebCrypto and warns when the iteration count or salt is below current guidance.

Limits to know

  • A matching checksum proves the file equals what the publisher hashed. It cannot tell you whether the publisher, or the page that listed the checksum, can be trusted. Get checksums over HTTPS from the official site, ideally together with a signature.
  • Base64-encoded digests are not compared by the tool; convert them to hex first (the Base64 tool can help; Base64 is an encoding, not encryption).
  • The extra algorithms are slower than SHA-256 because the browser has no built-in version of them.
  • Files are limited to 200 MB each.
  • The tool does not offer bcrypt, scrypt or Argon2. For stored passwords, use a dedicated password-hashing library on your server.

Frequently asked questions

Is MD5 still safe to use? Not for security. It is acceptable for catching accidental corruption or as a non-security cache key.

Is SHA-256 better than SHA-3? Neither is "better". SHA-256 is the more widely supported default, and SHA-3 is a structurally different alternative. Both are considered secure today.

Can I reverse a hash? No. Hashes are one-way. Weak or common inputs, such as simple passwords, can still be guessed by trying many candidates, which is why password hashing needs special slow algorithms and salts.

What is the difference between a hash and an HMAC? A hash needs only the data. An HMAC needs the data and a secret key, so only someone with the key can produce or check it.

Why do two tools give different SHA3-256 results? One of them is probably computing Keccak-256 (used by some blockchains) rather than NIST SHA3-256.

Related tools and guides

Sources and further reading