ConfigsApr 15, 2026·2 min read

hexyl — A Colorful Command-Line Hex Viewer

hexyl is a small, fast Rust hex viewer that colorizes bytes by category (ASCII, whitespace, non-ASCII, null) so binary inspection is actually scannable.

TL;DR
hexyl colorizes hex output by byte category so binary file inspection is fast and scannable from the terminal.
§01

What it is

hexyl is a small, fast command-line hex viewer written in Rust. It color-codes bytes by category: ASCII printable characters, whitespace, non-ASCII bytes, and null bytes each get a distinct color. This makes binary file inspection significantly more readable than traditional hex dump tools.

It targets developers, reverse engineers, and sysadmins who frequently inspect binary files, firmware images, or data formats from the terminal.

§02

How it saves time or tokens

hexyl's color coding lets you spot patterns in binary data at a glance. Instead of squinting at raw hex output from xxd or od, you immediately see where ASCII strings, padding, and non-printable regions are. The --skip and --length options let you jump to specific offsets without loading the entire file.

§03

How to use

  1. Install hexyl:
brew install hexyl
# Or on Linux:
cargo install hexyl
  1. View a binary file:
hexyl /bin/ls | head
  1. Inspect a specific offset range:
hexyl --skip 4096 --length 64 file.bin
§04

Example

# Install
brew install hexyl

# View first 256 bytes of a binary
hexyl --length 256 /usr/bin/file

# View bytes at offset 0x1000
hexyl --skip 4096 --length 128 firmware.bin

# Pipe from stdin
curl -s https://example.com/image.png | hexyl --length 64

Output uses colors: blue for ASCII, green for whitespace, yellow for non-ASCII, and dim gray for null bytes.

§05

Related on TokRepo

Key considerations

When evaluating hexyl for your workflow, consider the following factors. First, assess whether your team has the technical prerequisites to adopt this tool effectively. Second, evaluate the maintenance burden against the productivity gains. Third, check community activity and documentation quality to ensure long-term viability. Integration with your existing toolchain matters more than feature count alone. Start with a small pilot project before rolling out across the organization. Monitor resource usage during the initial adoption phase to identify bottlenecks early. Document your configuration decisions so team members can onboard independently.

§06

Common pitfalls

  • Piping hexyl output through a pager that does not support ANSI colors (like plain less) strips the color coding; use less -R instead.
  • Very large files output extensive data; always use --length to limit output or pipe through head.
  • Terminal themes with light backgrounds may reduce contrast for some byte categories; adjust terminal colors if needed.

Frequently Asked Questions

How does hexyl differ from xxd?+

xxd outputs plain hex without color coding. hexyl adds distinct colors for each byte category, making patterns immediately visible. hexyl also provides a cleaner layout with offset, hex, and ASCII columns.

Can hexyl handle large files?+

Yes. hexyl reads files efficiently and supports --skip and --length to view specific byte ranges without loading the entire file into memory.

Does hexyl work on Windows?+

Yes. hexyl is cross-platform Rust software that works on Windows, macOS, and Linux. Install via cargo or download pre-built binaries from the GitHub releases page.

Can I customize the color scheme?+

hexyl uses built-in colors mapped to byte categories. The color scheme is not configurable via command-line options, but it respects your terminal's color palette for the ANSI color slots it uses.

Is hexyl available in package managers?+

Yes. hexyl is available via Homebrew (macOS), apt (Debian/Ubuntu), pacman (Arch), and cargo (Rust). Check the GitHub README for the full list of package manager commands.

Citations (3)
  • hexyl GitHub— Colorful hex viewer written in Rust
  • hexyl README— Color-codes bytes by category: ASCII, whitespace, non-ASCII, null
  • hexyl GitHub— Cross-platform CLI tool available in major package managers

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets