Skip to content
Encode & Decode 7 min read

The Developer's Guide to Hexadecimal: Reading, Writing & Converting Hex

Learn to read and write hexadecimal, understand hex dumps, convert between hex, decimal, binary, and ASCII, and use a hex viewer for debugging binary data and file formats.

ToolsVito Team

What Hexadecimal Is

Hexadecimal (base-16) uses 16 digits: 0–9 and A–F (or a–f). Each hex digit represents exactly 4 bits (a nibble), so two hex digits represent exactly 1 byte (8 bits). This makes hex the most natural way to display binary data — one byte, two characters, no wasted space, no ambiguity.

Decimal 255 = Binary 11111111 = Hex FF
Decimal 16  = Binary 00010000 = Hex 10
Decimal 10  = Binary 00001010 = Hex 0A

Reading a Hex Dump

A typical hex dump has three columns:

Offset    Hex values                     ASCII
00000000  48 65 6C 6C 6F 20 57 6F  72 6C 64 0A  Hello.World.
  • Offset: Position in the file (hex address). This is the byte count from the beginning.
  • Hex values: Each byte as two hex digits, often grouped by 8 or 16 bytes.
  • ASCII: Printable characters shown as-is; non-printable bytes shown as dots.

Common Hex Values Developers Should Know

  • 0x0A: Line feed (LF, newline on Unix/Mac)
  • 0x0D: Carriage return (CR, used with LF for Windows line endings)
  • 0x20: Space character
  • 0x00: Null byte (end of C strings, padding)
  • 0xFF: All bits set (255, common sentinel value)
  • 0x1B: Escape character (ANSI/terminal control codes)
  • 0xEF 0xBB 0xBF: UTF-8 BOM (Byte Order Mark)

Hex in the Real World

  • Color codes: #FF5733 = R:255, G:87, B:51 in hex.
  • Memory addresses: Every pointer value is displayed in hex.
  • Error codes: 0x80070005 (Access Denied) — Windows error codes in hex.
  • Binary file analysis: Looking at the raw bytes of a PDF, image, or executable.
  • Cryptographic hashes and keys: SHA-256, AES keys, and certificates are displayed in hex.
  • MAC addresses: 00:1A:2B:3C:4D:5E — each pair is a hex byte.
  • Unicode code points: U+1F600 (😀) — the hex value 1F600.

View and Convert Hex Instantly

Use ToolsVito's Hex Viewer to convert any text or bytes to hexadecimal and decode hex back to text. See a side-by-side hex/ASCII view like a hex editor — all in your browser.

Try it now — free, runs in your browser

Hex Viewer

Text & bytes ↔ hexadecimal