メインコンテンツへスキップ
Z

MD5 vs SHA-256

MD5 vs SHA-256 compared — hash length, speed, collision resistance and security, plus free hash generators for both.

MD5 and SHA-256 are both hash functions, but they are not interchangeable: MD5 is fast and short (128-bit) but cryptographically broken, while SHA-256 (256-bit, part of SHA-2) is the modern secure standard.

MD5 vs SHA-256 at a glance

MD5 SHA-256
Output length 128-bit (32 hex) 256-bit (64 hex)
Speed Faster Slower (acceptable)
Collision resistance Broken (collisions known) Strong
Security use Not safe Recommended
Good for Non-security checksums Integrity, signatures, passwords (with salt+KDF)

When to use MD5

Use MD5 only for non-security checksums — quick deduplication or detecting accidental corruption. Never use it for passwords, signatures or anything an attacker could target.

When to use SHA-256

Use SHA-256 for anything security-related: file integrity, digital signatures, and (with a salt and a proper KDF like bcrypt/argon2) password storage.

Tools for MD5 & SHA-256

MD5 vs SHA-256

どのアルゴリズムに対応していますか?

MD4、MD5、SHA-1、SHA-224、SHA-256、SHA-384、SHA-512、SHA3-256、SHA3-384、SHA3-512、Keccak-256(Ethereumで使われる派生版)、CRC-32、NTLMに対応しています。

MD2、MD6、Whirlpoolがないのはなぜですか?

MD2は1996年に非推奨となっており、組み込むのに十分小さく、かつメンテナンスされているJS実装が存在しません。MD6は研究段階の設計にとどまり、実際に実装されたことがありません。Whirlpoolは700行にも及ぶルックアップテーブルが必要ですが、需要があれば追加を検討します。

SHA-256を選んでおけば問題ないですか?

多くの現代的な用途ではそれで十分です — SHA-256は高速で広くサポートされており、安全性も高いとされています。MD系やSHA-1系列とは完全に異なる方式が必要な場合は、SHA3-256やSHA-512を使ってください。パスワードの保存には、単純なハッシュではなくArgon2やbcryptといった専用のKDFを使用してください。

1つのアルゴリズムだけに特化したツールが欲しい場合は?

専用ページもご用意しています。MD5ハッシュジェネレーター、SHA-256ハッシュジェネレーター、SHA-1ハッシュジェネレーター、Keccak-256ハッシュジェネレーターをお試しください。

Keccak-256とSHA3-256の違いは何ですか?

Keccak-256はパディングに変更が加えられていないオリジナル版のKeccakアルゴリズムです。一方SHA3-256はNISTによって標準化されたバージョンで、パディングのバイトが若干異なります。同じ入力でも両者は異なる結果を返します。EthereumはKeccak-256を使用しています(Solidityのkeccak256()関数)。