Skip to content
uencoder

Base16

Base16 is hexadecimal encoding: every 4 bits map to one hexadecimal character (0-9, A-F), making it the simplest member of the Base family defined by RFC 4648.

Purpose

It offers a case-insensitive, minimal-alphabet text representation of binary data, convenient for compactly displaying byte values in logs, debug output, and protocol fields.

Mechanism

Each byte (8 bits) is split into a high and a low 4-bit nibble, each mapped to one hexadecimal character. One input byte produces 2 output characters, so the encoded length is exactly twice the original, with no padding.

Use cases

  • MAC address and IPv6 address notation
  • Hex dumps and diffs of binary files
  • Cryptographic digest display
  • HTML/CSS color values (#RRGGBB)

Examples

  • Input
    Hi
    Output
    4869

    H=0x48, i=0x69

Common errors

Inconsistent letter case causing comparison failures
Normalize to upper- or lowercase before comparing

Related terms

Related tools

References