encoding · level 2

Hex

Base 16 and the art of the hex dump.

100 XP

Hex

Hexadecimal — base 16 — is how programmers read bytes. Each byte is two hex digits:

Analogy

Think of how we tell time. "A quarter past three" and "3:15" and "15:15" all describe the same moment — three different notations for one underlying fact. Hex is a different notation for the same byte: the value doesn't change, but the form is compact and tidy for humans reading hardware. It's the same reason chefs say "a pinch" while chemists say "0.3 grams" — same amount, different writing system for different audiences.

Binary Decimal Hex
00000000 0 00
00001111 15 0f
10101010 170 aa
11111111 255 ff

Hex dumps

A hex dump shows a blob of bytes with their offsets, the hex representation, and an ASCII gutter on the right showing printable characters.

Why two digits?

A byte is 8 bits. Hex digits are 4 bits each. So exactly two hex digits cover a byte with no wasted space. This is why hex became the default format for everything from MAC addresses to SHA-256 hashes to cryptographic keys.

Tools in the wild

5 tools
  • xxdfree tier

    Canonical hex dump tool that ships with vim — also reverses hex back to bytes.

    cli
  • hexdumpfree tier

    BSD/Linux hex viewer; supports custom format strings for parsing binary headers.

    cli
  • CyberCheffree tier

    Browser 'cyber Swiss army knife' — chain hex / base64 / decode operations visually.

    service
  • ImHexfree tier

    Modern reverse-engineering hex editor with pattern language and data inspector.

    cli
  • Node Bufferfree tier

    `Buffer.from(str, 'hex')` and `buf.toString('hex')` — the standard JS hex codec.

    library