MD5 hash generator

MD5 (Ron Rivest, RFC 1321, 1992) turns any input into a 128-bit value, written as 32 hex characters. Practical collision attacks have existed since 2004, so never use it for passwords or signatures — but it is still fine as a fast checksum to spot accidental corruption or as a cache key.

Loading…

Where MD5 is used

  • File checksums published next to downloads
  • Cache keys and ETags
  • Deduplicating files (non-adversarial)

Command line

md5sum file.txt          # Linux
md5 file.txt             # macOS
echo -n "text" | md5sum  # a string, no trailing newline

In code

# Python
import hashlib
hashlib.md5(b"text").hexdigest()

// Node.js
require('crypto').createHash('md5').update('text').digest('hex')

Hashing is deterministic and one-way: the same bytes always give the same 128-bit value, and a one-character change scrambles it completely — try the avalanche demo.

Questions

How long is a MD5 hash?

128 bits, written as 32 hexadecimal characters (or 22 Base64 characters plus padding).

Is MD5 secure?

Broken for security. Collisions can be produced on purpose, so do not rely on it where an attacker controls input. It is fine for detecting accidental corruption.

Can I decrypt a MD5 hash?

No — hashing is one-way. Lookup sites only find inputs that are already in their tables of common strings.