Encrypt Online
Theme

Passwords & Hashing

SHA-256 vs MD5 vs Bcrypt

A practical chooser for checksums, integrity fingerprints, and password storage so you pick the right hash workflow the first time.

Encrypt Online Editorial Team3 min read
Encrypt Online guide cover on a lilac background with the headline "SHA-256, MD5 or bcrypt?". The complete SHA-256 name uses two generously spaced rows where useful. The algorithm can be identified without interpreting a number alone. The complete bcrypt name sits on one unbroken baseline, with natural letter spacing.

In brief

What it is: SHA-256, MD5, and bcrypt are not competing defaults; they serve different jobs and carry different security expectations.

Why it matters: Knowing where each one fits helps people choose the right tool and defend that choice clearly.

Worth knowing: Use a password hash for credentials, SHA-256 for modern checksums, and MD5 only where a legacy compatibility check specifically requires it.

MD5, SHA-256, and bcrypt all produce fixed outputs from input data, but they are built for different jobs. Matching the algorithm to the task supports reliable checksums, password storage, and comparisons.

Use Argon2id for new password-storage designs, bcrypt for systems that already use it, SHA-256 for integrity fingerprints, and MD5 only for required legacy checksums.

Use Hash Identifier to check a stored value for a recognizable prefix. Several algorithms produce the same number of bytes, so a plain hex or Base64 value may need a check against the application that created it.

What actually separates them

  • If a human password is involved in a new design, start with Argon2id. Use bcrypt when you are maintaining or migrating an existing bcrypt system.
  • If you need a general-purpose content fingerprint, start with SHA-256.
  • If an old system explicitly expects MD5, use it for compatibility and label that decision clearly.
  • Use encryption when the receiver needs to recover the original content later.
HashBest fitReversibleFast or slowBest matching tools
BcryptExisting bcrypt password-storage and verification systemsNoIntentionally slowBcrypt Generator, Verify Bcrypt
SHA-256Integrity checks, fingerprints, deterministic comparisonsNoFastSHA-256 Generator
MD5Legacy checksum compatibility where collision resistance is not the goalNoFastMD5 Generator

Mistakes that lead to the wrong choice

  • Using MD5 for new password storage.
  • Using SHA-256 directly for passwords instead of a password-hashing function such as Argon2id.
  • Treating bcrypt as a general-purpose checksum for files or payloads.
  • Calling a hash “encrypted” in user-facing docs.

Decision questions

Should a new application choose bcrypt?

Prefer Argon2id for a new password-storage design. Bcrypt remains useful when an application already stores bcrypt hashes or Argon2id is unavailable.

Is SHA-256 obsolete because bcrypt exists?

They solve different problems. SHA-256 remains useful for deterministic integrity fingerprints.

When is MD5 acceptable?

Mainly when compatibility with a legacy process is the real requirement and you are clear that it is not for modern password storage.

Reproduce it with exact bytes

  1. Freeze the exact input bytes, including encoding and newline handling.
  2. Generate or verify the digest with a small known sample.
  3. Record the algorithm, comparison rule, and storage format where future maintainers can find it.
Text
1. exact input bytes
2. hash or HMAC operation
3. constant-format comparison
4. document algorithm and encoding

Standards and references