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.
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.
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.
How to use
- Install hexyl:
brew install hexyl
# Or on Linux:
cargo install hexyl
- View a binary file:
hexyl /bin/ls | head
- Inspect a specific offset range:
hexyl --skip 4096 --length 64 file.bin
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.
Related on TokRepo
- AI Tools for Coding — Developer command-line tools and utilities
- Featured Workflows — Discover trending CLI tools 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.
Common pitfalls
- Piping hexyl output through a pager that does not support ANSI colors (like plain
less) strips the color coding; useless -Rinstead. - Very large files output extensive data; always use
--lengthto limit output or pipe throughhead. - Terminal themes with light backgrounds may reduce contrast for some byte categories; adjust terminal colors if needed.
Frequently Asked Questions
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.
Yes. hexyl reads files efficiently and supports --skip and --length to view specific byte ranges without loading the entire file into memory.
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.
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.
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
Related on TokRepo
Discussion
Related Assets
Hugging Face Tokenizers — Fast Text Tokenization for ML Pipelines
Hugging Face Tokenizers is a Rust-powered tokenization library with Python bindings that implements BPE, WordPiece, Unigram, and SentencePiece tokenizers with training and encoding speeds of gigabytes per second, used as the backbone for Transformers model tokenization.
Cleanlab — Find and Fix Label Errors in Any ML Dataset
Cleanlab is a data-centric AI Python library that automatically detects label errors, outliers, and data quality issues in classification and regression datasets, helping improve model accuracy by cleaning training data rather than tuning models.
Hugging Face Datasets — Access and Process ML Datasets at Scale
Hugging Face Datasets is a Python library for efficiently loading, processing, and sharing machine learning datasets with Apache Arrow-backed memory mapping, streaming support, and access to thousands of community datasets on the Hub.