For a new cryptographic use that needs collision resistance, choose SHA-256—not MD5. MD5 may still work as an inline checksum when the goal is only to catch accidental errors, but neither an MD5 nor a plain SHA-256 digest is an appropriate way to store passwords.
MD5 and SHA-256 at a glance
Both algorithms turn input data into a fixed-length digest, often called a hash. Their digest lengths differ, but the practical choice depends on what you need the hash to do—not just how many bits it outputs.
As an Amazon Associate I earn from qualifying purchases.
| Question | MD5 | SHA-256 |
|---|---|---|
| Digest length | 128 bits, according to IETF RFC 6151 (2011). | 256 bits, specified by NIST FIPS 180-4 (2015). |
| Collision resistance | RFC 6151 says MD5 is no longer acceptable where collision resistance is required, including digital signatures. | NIST SP 800-107 Rev. 1 (2012) gives SHA-256 an expected collision resistance of 128 bits. |
| Suitable for password storage as a single fast hash? | No. | No. |
| Relative speed | A general speed ranking is not established here; performance depends on implementation and workload. | A general speed ranking is not established here; performance depends on implementation and workload. |
What collision resistance means—and why it matters
A collision occurs when two different inputs produce the same digest. Collision resistance is the difficulty of finding such a pair. It matters when a system relies on a hash to bind a signature or other security-sensitive operation to particular data: if an attacker can create two different inputs with the same digest, a hash-based check may no longer provide the intended protection.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallDigest length alone does not describe every security property. NIST SP 800-107 Rev. 1 estimates SHA-256’s collision resistance at 128 bits and its preimage resistance at 256 bits. Preimage resistance concerns finding an input for a chosen digest; second-preimage resistance concerns finding a different input that matches the digest of a specified input. These are distinct attack goals, not interchangeable descriptions of “hash strength.”
#1 Best Overall
When to use SHA-256
Choose SHA-256 for a new design that requires collision resistance, including digital-signature-related uses. NIST specifies SHA-256 as part of the Secure Hash Standard and describes secure hashes as a way to detect message changes. Its standard also discusses their use in digital-signature verification and message-authentication codes.
FIPS 180-4 was published in August 2015. NIST’s catalog records a March 2023 planning note that the standard would be revised following public comment. Check NIST’s current publication catalog for a successor when making a compliance decision.
When an MD5 checksum may still be acceptable
MD5 should not be used where collision resistance is required. RFC 6151’s narrow exception is an inline checksum used solely to protect against errors. In that limited setting, MD5 can detect accidental corruption if the expected checksum is trustworthy and the application clearly states the security service it provides.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →This exception does not make MD5 a safe choice for signatures or protection against a malicious attacker. It is specifically about detecting errors, not establishing that data came from a particular person or was not deliberately replaced.
Does a matching hash prove a download is authentic?
No—not by itself. A matching digest shows that the file you checked produces the same digest as the value you compared it with. If an attacker can replace both the file and the published checksum, an unauthenticated comparison cannot tell you that the file is genuine.
When malicious substitution is a concern, obtain the expected digest through a trustworthy authenticated channel or verify a digital signature. A hash can help detect a change; authentication is what establishes whose data or checksum you are trusting.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Why neither hash is right for storing passwords
A single MD5 or SHA-256 operation is a fast general-purpose hash, not a password-storage scheme. Fast hashing makes it practical for an attacker with stolen password data to test guesses offline. Choosing SHA-256 because it is stronger than MD5 does not solve that problem.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsNIST SP 800-63B Revision 4 says verifiers should store passwords in a form resistant to offline attacks, using a suitable password-hashing scheme with a salt and a cost factor. The cost factor makes guessing more expensive and should be set as high as practical without harming verifier performance. Use a dedicated scheme designed for password hashing rather than either bare digest.
Quick Recap
Best Value
Choosing the right option
- New security-sensitive design or digital signatures: use SHA-256 when collision resistance is required; do not use MD5.
- Accidental-error check only: MD5 can fit RFC 6151’s limited inline-checksum exception, provided the application makes the limited security purpose clear.
- Download authenticity against an attacker: use a trusted authenticated source for the digest or verify a digital signature; a bare checksum is not proof of origin.
- Password storage: use a suitable salted password-hashing scheme with an appropriately expensive cost factor, not MD5 or plain SHA-256.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




