← All posts

14 October 2026 · Ultracore Team

MD5 vs SHA-256: Which Hash Function Should You Use?

Hash functions are one of the quiet building blocks of computing. They verify downloads, power digital signatures, deduplicate files and protect passwords. But not all hashes are equal, and using the wrong one can create a real security hole.

What does a hash function do?

A hash function turns any input, a word or a 4 GB video, into a short fixed-length fingerprint. A good cryptographic hash has three key properties:

  • Deterministic: the same input always gives the same hash
  • Avalanche effect: changing one character changes the whole hash
  • One-way and collision-resistant: you can’t work back to the input, or find two inputs with the same hash

Try it in our Hash Generator: hash hello, then Hello, and compare the results.

Why MD5 and SHA-1 are broken

MD5 (128-bit) was the standard in the 1990s. In 2004 researchers showed how to create two different inputs with the same MD5 hash, a *collision*, and attacks have only got faster since. Today, collisions can be created in seconds on a laptop.

SHA-1 (160-bit) followed the same path: in 2017, Google and CWI Amsterdam published two different PDF files with the same SHA-1 hash.

Collisions matter whenever an attacker can *choose* the input. A forged document, certificate or software update with the same hash as a genuine one passes any check based on that hash.

When MD5 is still fine

MD5 still works for spotting accidental changes, where nobody is trying to fool you: checking a file copied correctly between drives, or detecting duplicate files. It’s fast and widely supported. Just never use it where an attacker is involved.

What to use instead

  • SHA-256 for checksums, signatures and integrity checks. It’s the modern default and is used in TLS certificates and software signing.
  • SHA-512 offers a larger output and is often faster on 64-bit machines.
  • HMAC-SHA256 when you need to prove a message came from someone holding a shared secret, such as webhook signatures. A plain hash can’t do that, because anyone can compute it.

Never hash passwords with SHA-256

This surprises people. SHA-256 is secure, but it’s designed to be fast, and modern GPUs compute billions of hashes per second. If your database leaks, fast hashes let attackers test enormous lists of common passwords against every account.

Password storage needs algorithms that are deliberately slow and use a unique salt per password: Argon2id, bcrypt or scrypt. Every mainstream language has a well-tested library for them, so never write your own.

How to verify a file’s checksum

Software sites often publish a SHA-256 checksum next to downloads. To check that your copy is genuine and complete, calculate its hash and compare:

# macOS
shasum -a 256 installer.dmg

# Linux
sha256sum installer.iso

# Windows (Command Prompt or PowerShell)
certutil -hashfile installer.exe SHA256

If the hashes match character for character, the file is identical to the one the publisher hashed. Prefer not to use the command line? The Hash Generator can hash a file in your browser, without uploading it, and highlights the match when you paste the published checksum.

Free toolTry the Hash GeneratorRuns in your browser. No sign-up.

Have a project in mind? Let’s talk it through.

A free, no-commitment call to understand what you’re building and how we can help.