Xerobit

Hex Dump Viewer: Canonical Hex and ASCII Display

Paste text or raw hexadecimal bytes to generate a canonical hex dump matching the layout of <code>hexdump -C</code>. Each line shows the byte offset, sixteen hex pairs and an ASCII gutter where printable characters appear and control codes show as dots. The tool runs entirely in your browser and nothing is uploaded.

Hex Dump

00000000  48 65 6c 6c 6f 2c 20 57  6f 72 6c 64 21           |Hello, World!|
0000000d

How to use the hex dump viewer

  1. Select the Input type: choose Text to encode a string as UTF-8 bytes, or Hex string if you already have raw hexadecimal values.
  2. Enter your data in the Input data field. For hex mode, spaces and common prefixes like 0x are ignored automatically.
  3. The canonical hex dump appears instantly below. Each row displays the byte offset, up to sixteen hex pairs and the ASCII representation enclosed in pipe characters.

Understanding the canonical hex dump format

The canonical format produced by this hex dump viewer matches the output of the Unix command hexdump -C (the xxd utility uses a different layout, with a colon after the offset and no pipes). Every line follows a strict column structure that makes it easy to locate any byte by its position.

The first column is an eight-character hexadecimal offset indicating the zero-based index of the first byte on that line. The middle section contains up to sixteen two-digit hex values separated by spaces, with an extra gap between the eighth and ninth bytes to improve readability. The final column wraps the ASCII representation in pipe characters (|), replacing non-printable bytes with a dot.

For example, the string Hello produces:

OffsetHex bytesASCII
0000000048 65 6c 6c 6f|Hello|

The offset 00000000 means these are the first five bytes. The value 48 is the ASCII code for H, 65 for e, and so on. If you need to convert individual values, tools like hex to decimal or decimal to hex handle single-number conversions.

How offsets and padding work

The offset column counts bytes from zero. A file or input of 256 bytes will have its last line start at offset 000000f0 if the total length is exactly 256, because f0 in base 16 equals 240, and the final line holds the remaining sixteen bytes. You can verify this math using a hex calculator.

When the total number of bytes is not a multiple of sixteen, the final line is padded with spaces so the ASCII gutter always aligns vertically. This alignment is what distinguishes a canonical hex dump from simpler formats. Without consistent spacing, scanning columns visually becomes difficult when inspecting large blocks of data.

Unlike hexdump -C, this tool prints every line and does not collapse runs of identical lines into a *. The extra space between byte eight and byte nine splits each row into two groups of eight. This convention dates back to early memory inspectors and helps the eye track positions without counting every pair individually.

Common uses for hex dumps

Developers and security analysts rely on hex dumps whenever they need to see exactly what bytes a file or network packet contains, beyond what a text editor reveals. Common scenarios include:

  • Inspecting file headers: Magic numbers at the start of files identify their format. A PNG image begins with 89 50 4e 47 0d 0a 1a 0a, while a PDF starts with 25 50 44 46 (the ASCII string %PDF).
  • Debugging binary protocols: When working with TCP payloads or serial communication, viewing the raw bytes helps pinpoint framing errors or unexpected control characters.
  • Verifying encoding: UTF-8 multi-byte sequences are visible immediately. The character e with acute accent encodes as c3 a9, which a plain text view would hide.
  • Comparing binary files: Generating a hex dump for two files allows side-by-side comparison using standard text diff tools.

Text versus hex input modes

This viewer supports two input modes to cover different workflows. In Text mode, the input string is encoded as UTF-8 before generating the hex dump. This means standard ASCII characters map one-to-one to single bytes, but characters outside the basic Latin set may occupy two, three or four bytes each.

In Hex string mode, the input is treated as raw hexadecimal digits. Spaces, colons, commas and 0x prefixes are stripped automatically so you can paste output from other tools without manual cleanup. An odd number of valid hex digits will produce an error because each byte requires exactly two nibbles.

If you need to go the other direction and extract readable text from a hex dump, use a hex to text converter. For converting between bases, the binary to hex converter handles bit-level transformations.

Reference table of common byte values

The following table lists frequently encountered byte values and how they appear in a hex dump. Control characters and whitespace are shown as dots in the ASCII gutter.

Byte (hex)DecimalMeaningASCII gutter display
000Null terminator.
099Horizontal tab.
0a10Line feed (newline).
0d13Carriage return.
2032Space (space)
4165Uppercase AA
7f127Delete.
ff255Maximum byte value.

Bytes from 20 to 7e inclusive are considered printable ASCII and display as themselves. Everything outside that range renders as a period to prevent terminal corruption or invisible characters from disrupting the layout.

Worked examples

ExampleInputResult
Hello WorldInput type: text; Input data: Hello, World!00000000 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21 |Hello, World!| / 0000000d
Raw hex bytesInput type: hex; Input data: 48656c6c6f2c20576f726c642100000000 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21 |Hello, World!| / 0000000d
Control charactersInput type: hex; Input data: 000102030405060708090a0b0c0d0e0f1011121300000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |................| / 00000010 10 11 12 13 |....| / 00000014

FAQ

What is a hex dump?

A hex dump is a structured display of binary data showing each byte as a two-digit hexadecimal number alongside its offset and a human-readable ASCII interpretation. It lets you inspect the exact contents of files, memory or network packets.

What does the canonical format mean?

The canonical format refers to the specific layout used by the Unix command hexdump with the -C flag. It arranges sixteen bytes per line with an eight-digit offset, spaced hex pairs and a pipe-delimited ASCII column.

Why do some characters show as dots?

Bytes outside the printable ASCII range of 32 to 126 are replaced with dots in the ASCII gutter. This prevents control characters like null bytes or escape sequences from corrupting the display or causing unintended terminal behavior.

Can I paste hex output from another tool?

Yes. Select the Hex string input mode and paste your data. The viewer strips spaces, colons, commas and 0x prefixes automatically, accepting most common hex representations.

Is my data sent to a server?

No. The hex dump generation happens entirely in your browser using JavaScript. Your input never leaves your device and nothing is uploaded anywhere.

How do I convert the hex values back to text?

You can use a dedicated hex to text tool to decode the hexadecimal bytes back into a readable string. That approach handles UTF-8 decoding properly for multi-byte characters.