MD5 vs SHA-1 vs SHA-256: What Is Hashing and Which Should You Use?

A hash function turns any input – a word, a document, a 4 GB file – into a short fixed-length fingerprint. Change a single character and the fingerprint changes completely. Hashes are used to verify downloads, detect changes, sign API requests and store passwords safely (with the right algorithm).

Free tool
Generate a hash
Create MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of text or files, compare against a published checksum, and make HMAC signatures. Free – calculated in your browser.
Open Hash Generator →

Properties of a good hash

  • Deterministic: the same input always gives the same hash.
  • Fixed length: SHA-256 always produces 64 hexadecimal characters.
  • One-way: you cannot turn the hash back into the input.
  • Avalanche effect: a tiny change gives a completely different hash.
  • Collision-resistant: it should be practically impossible to find two inputs with the same hash.

The common algorithms

AlgorithmOutput lengthStatus
MD5128 bits (32 hex characters)Broken for security – collisions are easy. OK for non-security checks
SHA-1160 bits (40 hex)Broken for security – practical collisions shown in 2017
SHA-256256 bits (64 hex)Secure – the standard choice
SHA-384384 bits (96 hex)Secure
SHA-512512 bits (128 hex)Secure, often fast on 64-bit CPUs

Rule of thumb: use SHA-256 unless a system requires something else.

Verify a downloaded file

Many software sites publish a SHA-256 checksum next to the download.

  • Open the Hash Generator and choose File.
  • Select the downloaded file and SHA-256.
  • Paste the published checksum into the compare field.
  • A match means the file is complete and unchanged.

What is HMAC?

An HMAC is a hash combined with a secret key. Only someone with the key can produce the right value, so it proves a message came from a trusted sender and was not changed. Webhooks from payment providers and many APIs sign requests with HMAC-SHA256.

Passwords: never use a plain hash

MD5, SHA-1 and even SHA-256 are designed to be fast – which lets attackers try billions of guesses per second against a leaked database. Store passwords with a slow, salted password-hashing algorithm instead: Argon2id, bcrypt or scrypt (or PBKDF2 where required). Your framework’s built-in password functions usually do this correctly. For users, see how to create a strong password.

Hashing vs encoding vs encryption

Reversible?Needs a key?Purpose
Encoding (Base64, URL encoding)Yes, by anyoneNoRepresent data safely
HashingNoNo (HMAC: yes)Fingerprint and verify
EncryptionYes, with the keyYesKeep data secret

Learn more in what is Base64 and what is URL encoding.

FAQ

Is MD5 still safe?

Not for security. It is fine for detecting accidental changes, such as cache keys or duplicate detection.

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

Output length and internal design. Both are secure; SHA-256 is more widely used.

Can a hash be decrypted?

No. Hashing is one-way. “Hash crackers” only guess common inputs and compare results.

Why do two different files have the same MD5?

MD5 collisions can be created deliberately. Use SHA-256 for security.

Are my files uploaded?

No. Hashes are calculated in your browser.

Free tool
Try the free Hash Generator
No signup and nothing uploaded – it runs right in your browser. Browse all 74 free tools on our Free Tools page.
Open Hash Generator →

Need a website or app for your business? Talk to Techpass Master – we design and build websites and apps for clients worldwide.

WhatsApp us📞 Call now