Hash generator · Guide
MD5 Hash Bit Length: 128 Bits, 16 Bytes, 32 Characters
Every MD5 digest is exactly the same size regardless of input. Knowing the three ways that size is written — bits, bytes, characters — saves you from mis-sized columns and mistaken identification.
The three numbers
128 bits. 16 raw bytes. 32 characters when printed as hexadecimal, since each byte becomes two hex digits. Encoded as Base64 it is 24 characters including padding, or 22 without.
Input size is irrelevant: an empty string and a 50 GB disk image both produce 128 bits. The algorithm folds everything into a fixed four-word state, so there is nowhere for extra length to go.
Storing a digest
Pick the representation deliberately — the binary form halves the storage and indexes faster, the hex form is readable in a query result:
hash CHAR(32) NOT NULL -- hex, readable
hash BINARY(16) -- raw bytes, MySQL
hash BYTEA -- raw bytes, PostgreSQLAvoid VARCHAR(255) out of habit: it invites padded or truncated values that silently never match. If you store hex, use a binary collation so comparison is not affected by case.
Identifying a hash by length
32 hex characters is MD5. 40 is SHA-1. 64 is SHA-256. 128 is SHA-512. This is the quickest triage when a checksum file does not name its algorithm.
Two traps: a 32-character string containing letters beyond f is not hexadecimal at all, and a 60-character string starting with $2y$ is bcrypt, not a plain digest. Length narrows the options, it does not prove the algorithm.
Frequently asked questions
How many characters is an MD5 hash?
32 hexadecimal characters, which is 128 bits or 16 bytes.
Can I shorten an MD5 hash?
You can truncate it for display, but every dropped bit makes collisions more likely. Never truncate a digest used for verification.
Does a longer file give a longer hash?
No. The output is fixed at 128 bits for any input.
Ready to try it?
Open the free browser-based Hash generator and apply what you just read — no sign-up, runs locally.
Open the Hash generator tool