hexyl: A Colored Hex Viewer That Actually Makes Sense
Ever found yourself staring at a hex dump, squinting at rows of indistinguishable bytes, trying to figure out whether that 0x7F is part of ASCII or some binary payload? Most hex viewers are gray walls of text. hexyl changes that by adding color categories to each byte, making patterns jump out at you instantly.
It's a terminal tool written in Rust, built for developers who work with binary files regularly — firmware, executables, image files, or just debugging a corrupt download. Instead of treating all bytes equally, hexyl uses different colors for ASCII printable characters, control characters, null bytes, and raw binary data. The result feels like syntax highlighting for hex.
What It Does
hexyl is a command-line hex viewer that reads any file or stdin and outputs a color-coded hex dump to your terminal. Each byte gets a background or foreground color based on its meaning:
- ASCII printable characters (letters, numbers, punctuation) appear in one color
- Control characters (like tabs or newlines) get another
- Null bytes stand out clearly
- High bytes (over 127) use a distinct palette
The output shows three columns per line: byte offset (decimal + hex), hex values, and the ASCII representation. Colors make the last column especially useful — you can spot text fragments or repeating patterns at a glance.
Why It’s Cool
The obvious win here is pattern detection. If you’re looking at a PNG file, you’ll see the PNG header bytes in one color and metadata in another. Corrupted data? Null bytes or unexpected control characters will pop out visually.
The tool is also fast and lightweight. Written in Rust with no dependencies beyond what you’d install anyway (like less or head). It handles files of any size by streaming, so you can pipe hexyl some_large_binary.bin | head -50 without memory issues.
But the design choice that stands out: colors aren't arbitrary. The palette follows logical rules. Non-printable bytes are muted; printable characters are bright. This means you can train your eyes to ignore noise and focus on meaningful data within seconds of using it.
For reverse engineers, firmware developers, or anyone who touches raw bytes — this is the kind of small tool that becomes muscle memory.
How to Try It
hexyl is available via most package managers. Here are a few quick ways:
- macOS (Homebrew):
brew install hexyl - Linux (Debian/Ubuntu):
apt install hexyl - Arch Linux:
pacman -S hexyl - Cargo (Rust):
cargo install hexyl - Windows: Use
scoop install hexylor download the binary from releases
Once installed, just run:
hexyl some_file.bin
Or pipe anything:
cat /dev/urandom | head -20 | hexyl
Want to see it in action? The repo has screenshots showing before/after comparisons.
Final Thoughts
I’ve used xxd and od for years, and they work fine. But hexyl is one of those rare tools that makes you feel like you’ve been working with the wrong hex viewer all along. The color coding isn’t just cosmetic — it genuinely speeds up analysis. If you deal with binary data more than once a month, this is worth the five minutes to install. You’ll wonder why no one did it sooner.
Originally spotted on @githubprojects
Repository: https://github.com/sharkdp/hexyl