hexyl: A Hex Viewer for the Terminal
! Logo
Hexyl: A Colorful Hex Viewer for the Terminal
Hexyl is a compact, high-contrast hex viewer designed for terminal enthusiasts who crave clarity and quick insight when peeking into binary data. The project centers around a color-coded representation of bytes that helps you distinguish between different kinds of characters and control bytes at a glance. In this blog post, we’ll take a closer look at what Hexyl does, how it looks, where you can install it, and how you can tailor its look and behavior to your preferences.
Overview and Core Idea
Hexyl is a terminal-based hex viewer that emphasizes readability through color. The colored output separates bytes into distinct categories:
- NULL bytes
- Printable ASCII characters
- ASCII whitespace characters
- Other ASCII characters (non-whitespace, printable, but not the primary printable group)
- Non-ASCII bytes (bytes with high-bit set)
This categorization makes it easier to scan large sections of data, spot patterns, and identify anomalies without needing to scroll through dense, monochrome hexadecimal dumps. The tool is designed to be fast, minimal, and friendly to common terminal color schemes, while still allowing users to customize the color palette to their liking.
A Quick Look at the Preview
Hexyl’s visual design is best understood by seeing it in action. The project provides a few preview images that showcase how the colored panels look in practice. Here are four snapshots that illustrate the layout, color-coding, and overall aesthetic:
- Preview image 1
- Preview image 2
- Preview image 3
- Preview image 4
Images:

These visuals highlight the three-panel design typical of Hexyl: a left column showing file offset, a middle hex byte grid with color-coded categories, and a right-hand ASCII representation that mirrors the data in a human-friendly form. The consistent alignment, clear separators, and well-chosen color palette enable rapid parsing, even when working with large binary files or streams.
What Makes Hexyl Stand Out
- Color-coded byte categories: By assigning a distinct color to each class of byte, Hexyl allows your eyes to track patterns and irregularities across long sequences. The system handles NULLs, ASCII whitespace, ASCII printable characters, other ASCII characters, and non-ASCII bytes with dedicated colors.
- Three-panel layout: The left offset column, a central hex grid, and a right-hand ASCII/printable panel provide a comprehensive view in a single glance.
- Terminal-friendly: Designed for ANSI escape sequences, Hexyl works well in modern terminals, including those that are Linux, macOS, or Windows-based (with proper ANSI support).
- Configurable colors: Users can fine-tune colors via environment variables, including both named colors and RGB hex codes, to match their terminal theme or personal preferences.
- Lightweight and fast: The tool is built to be small and efficient, suitable for quick inspections, scripting, or ad-hoc binary exploration.
Sections
1) Getting Started: A Friendly Introduction Hexyl is intentionally straightforward to install and get running, whether you’re on a desktop Linux distribution, macOS, or Windows. The project offers a broad set of installation options to accommodate different package managers, ecosystems, and user preferences. The goal is to get you up and running with a few commands, no heavy setup required.
2) Preview Gallery: Seeing Hexyl in Action The preview images above demonstrate what you can expect when you run Hexyl on real data. You’ll notice the alignment of the left offset column with the hexadecimal byte values in the center, followed by the ASCII interpretation on the right. The color cues guide you to obvious anomalies or interesting patterns, such as clusters of NULL bytes, sections filled with spaces, readable text, or bytes that fall outside the standard ASCII range.
3) How Hexyl Works: The Color-Coded Canon
- Byte categorization: Hexyl classifies each byte into a color bucket:
- NULL (0x00)
- ASCII printable (e.g., letters, digits, punctuation)
- ASCII whitespace (space, tab, newline, etc.)
- Other ASCII (non-printable distinct ASCII characters falling under 0x20–0x7F range, excluding whitespace)
- Non-ASCII (bytes with the highest bit set, > 0x7F)
- Visual mapping: Each category uses a distinct terminal color, with popular options like black, blue, cyan, green, magenta, red, yellow, white, and their bright variants, or even a custom RGB hex value for precise theming.
- Alignment and readability: The standard three-panel layout provides a stable frame for rapid scanning. You can compare the left offset column to the hex data in the center and the ASCII interpretation on the right, creating a mental map of the file structure at a glance.
4) Installation Central: How to Get Hexyl on Your System The Hexyl project supports a wide array of platforms, making it relatively easy to integrate into your existing workflow. Below is a snapshot of the most common installation pathways, along with some notes to help you decide which route is best for you.
On Ubuntu and other Debian-based distributions
Official package (for Ubuntu 19.10+ or newer): sudo apt install hexyl
If you’re on older Ubuntu versions, download the latest .deb package from the release page and install it manually:
- sudo dpkg -i hexyl0.15.0amd64.deb (adjust version and architecture as needed)
On Debian
Official Debian package: sudo apt-get install hexyl
For older Debian releases, follow the same manual install approach as with Ubuntu
On Fedora
Official Fedora package: sudo dnf install hexyl
On Arch Linux
Official Arch package repository: pacman -S hexyl
On Void Linux
Command-line: xbps-install hexyl
On Gentoo
Available in the dm9pZCAq overlay:
- sudo eselect repository enable dm9pZCAq
- sudo emerge --sync dm9pZCAq
- sudo emerge sys-apps/hexyl::dm9pZCAq
On macOS
Homebrew: brew install hexyl
MacPorts: sudo port install hexyl
On FreeBSD
pkg install hexyl
On NetBSD
pkgin install hexyl
On OpenBSD
doas pkg_add hexyl
On Termux (Android)
pkg install hexyl
or apt install hexyl
Via Nix
nix-env -i hexyl
Via Guix
guix package -i hexyl
Or add hexyl to your system configuration
On Windows
Release builds available (via the project’s release page)
Alternatively, install from source via cargo, snap, or scoop
Use a terminal with proper ANSI support (ConEmu, Windows Terminal, etc.)
Via cargo (source)
If you have Rust 1.56 or higher:
- cargo install hexyl
Or clone the repository and install from source:
- git clone https://github.com/sharkdp/hexyl
- cargo install --path ./hexyl
Note: Pandoc is needed if you want to convert the man page from Markdown to the man page format
Via Snap
sudo snap install hexyl
Via Scoop
scoop install hexyl
Via X-CMD
x env use hexyl
On other distributions
Check the release page for binary builds and installation notes
Tips:
- Ensure your terminal supports ANSI escape sequences to enjoy the full color experience.
- If you’re working across multiple platforms, consider a package manager like Homebrew, Nix, or Guix for consistency.
5) Configuration: Personalizing Hexyl’s Colors Hexyl’s color palette can be tuned via environment variables. This enables you to tailor the appearance to your preferences or to harmonize with your terminal theme. The environment variables map directly to the byte categories, and you can mix standard color names with bright variants or even custom RGB hex colors.
The available color keys are:
- HEXYLCOLORASCII_PRINTABLE: The color for printable ASCII characters
- HEXYLCOLORASCII_WHITESPACE: The color for ASCII whitespace
- HEXYLCOLORASCII_OTHER: The color for other ASCII characters (non-zero, non-whitespace)
- HEXYLCOLORNULL: The color for the null byte (0x00)
- HEXYLCOLORNONASCII: The color for non-ASCII bytes (> 0x7F)
- HEXYLCOLOROFFSET: The color for the lefthand file offset
Color values can be any of the eight standard terminal colors: black, blue, cyan, green, magenta, red, yellow, white Bright variants are supported as well: bright blue, bright green, etc.
If you want to push Hexyl to an exact shade that matches your theme, you can also use RGB hex notation, for example: HEXYLCOLORASCIIPRINTABLE=blue HEXYLCOLORASCIIWHITESPACE="bright green" HEXYLCOLORASCII_OTHER="#ff7f99"
A concrete example of a color configuration: HEXYLCOLORASCIIPRINTABLE=blue HEXYLCOLORASCIIWHITESPACE="bright green" HEXYLCOLORASCIIOTHER="#ff7f99" HEXYLCOLORNULL=red HEXYLCOLORNONASCII="bright yellow" HEXYLCOLOR_OFFSET=cyan
This flexibility makes Hexyl adaptable to a wide range of environments, from dimly lit terminals to vibrant, high-contrast setups. It also helps developers who want the tool to blend seamlessly into their existing workflows or documentation pipelines.
6) License and Legal Notes Hexyl is released under a dual-license model, offering developers a choice between:
- Apache License, Version 2.0
- MIT License
This dual approach is common in open-source ecosystems, providing both permissive licensing and compatibility with a wide array of projects. The licenses are accessible at:
- LICENSE-APACHE
- LICENSE-MIT
As with any open-source project, the licenses ensure you can use, modify, and distribute Hexyl in both personal and commercial contexts, provided you comply with the terms of the chosen license.
7) Practical Tips for Getting the Best Experience
- Use a modern terminal: Prefer terminals that fully support ANSI color sequences and have robust font rendering. Windows users should consider Windows Terminal or ConHost v2+ for the best compatibility.
- Try different color schemes: If the default palette doesn’t feel right, experiment with the environment variables to find the best contrast for your eyes.
- Combine with scripting: Hexyl can be a part of larger workflows. For example, you can pipe binary data through Hexyl in a shell script to quickly inspect outputs from commands like curl, dd, or custom data processing scripts.
- Performance considerations: Hexyl is designed to be lightweight, but on extremely large files you may want to limit the amount of data displayed in a single session or run it in a terminal that handles large scrollbacks efficiently.
8) Real-World Scenarios: When Hexyl Shines
- Binary data inspection: Quickly identify patterns in binary files, such as PE or ELF headers, by visually scanning the color-coded ASCII and non-ASCII bytes.
- Log and data forensics: Investigate logs or data dumps where a mix of text and binary payloads requires fast toggling between hex and ASCII representations.
- Encoding checks: Confirm how non-ASCII data appears in a file and verify the presence of control characters or embedded Unicode sequences.
- Educational use: Teach students or colleagues how data is structured at the byte level, using color cues to reinforce the concept of byte classes.
9) Small but Mighty: The Design Philosophy Hexyl embodies a philosophy of minimalism coupled with maximal readability. It avoids feature bloat while delivering a precise, focused tool for hex viewing. The three-panel layout, combined with color coding, ensures that you don’t have to squint to make sense of a dump. The software’s configurability means it can adapt to various use cases—from quick one-off checks during a debugging session to consistent usage within a developer’s daily workflow.
Conclusion
Hexyl is more than just a hex dump viewer; it is a thoughtfully designed tool that brings clarity to raw binary data through color, layout, and flexibility. Its broad installation options mean you can put Hexyl to work on nearly any modern development machine, whether you prefer Linux, macOS, Windows, or a containerized environment. The ability to tailor the color palette ensures it can live comfortably in any terminal theme, from dark, low-contrast setups to vivid, high-contrast configurations. Whether you are a software developer, a systems administrator, a security researcher, or simply a curious learner, Hexyl offers a fast and elegant way to explore binary data with confidence.
Images and Visual References
To get a sense of Hexyl’s aesthetic and workflow, you can refer to the included visuals and badges as shown at the top of this post. The logo, CI/CD badge, and crates badges set the branding and build status, while the four preview images demonstrate the tool in action on real data. These images illustrate how the left offset, center hex values, and right ASCII panel align in a clean, readable split that makes binary exploration approachable and efficient.
If you’d like to try Hexyl for yourself, start with your preferred installation method listed above, then run a simple example to see the color-coded output in your terminal:
- cat example.bin | hexyl
Additional Resources
- Official repository and release pages: https://github.com/sharkdp/hexyl
- Documentation and usage notes: available within the project’s doc files
- Pandoc for man page conversion (if you need to generate a man page from Markdown)
- Community discussions and support channels (as maintained by the project)
Final Thoughts
Hexyl demonstrates how a focused tool, when combined with a thoughtful color grammar and practical layout, can dramatically improve the experience of working with binary data in a terminal. Its cross-platform reliability, along with an emphasis on customization, makes it a versatile addition to any developer’s toolkit. If you’re often peeking into hex dumps or need a quick, readable way to survey byte patterns, Hexyl is well worth trying.
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/sharkdp/hexyl
GitHub - sharkdp/hexyl: hexyl: A Hex Viewer for the Terminal
Hexyl is an open-source, color-coded hex viewer for terminals....
github - sharkdp/hexyl