Hash Lab

Your badges

Every message has a fingerprint.

A hash function turns any input, a word or a whole movie, into a short fixed-size fingerprint. Type below and watch the SHA-256 fingerprint of your message, drawn as 64 colors. Change a single character and the whole thing reshuffles.

SHA-256, one stripe per hex digit

Six algorithms, one message

Every row below hashes the message you typed above, live. Notice three things: the same input always gives the same output, the output length never changes no matter how much you type, and nothing about the output hints at the input.

What actually gets hashed: bytes

Hash functions never see letters, only bytes. Plain English letters take one byte each in UTF-8. Try an accented letter or an emoji: it takes two to four bytes (highlighted).

Hex, Base64 and binary are the same hash. They’re just different ways to write the same bits. Hex uses 4 bits per character, Base64 uses 6, binary uses 1. Switch formats above and the fingerprint stripes stay identical.

Why there’s no HMAC for CRC32. CRC32 is linear: an attacker can change a message and calculate exactly how to fix the checksum, key or no key. HMAC needs a cryptographic hash underneath, so the CRC32 row turns itself off when you enable a key.

MD5, SHA-1 and SHA-256 are Merkle–Damgård designs: the input is padded and processed in 64-byte blocks, and the output is the final internal state. SHA-512 uses 128-byte blocks. SHA3-256 is a sponge (Keccak) and releases only part of its 1600-bit state. That difference is why plain SHA-256 is vulnerable to length-extension attacks and SHA-3 is not. See the HMAC lab.