explaingit

sharkdp/hexyl

10,135RustAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

hexyl is a color-coded command-line hex viewer for inspecting the raw bytes of any file, it uses distinct colors for null bytes, printable text, whitespace, and binary data to make patterns easy to spot.

Mindmap

mindmap
  root((repo))
    What it does
      View file bytes
      Color-coded output
      Binary inspection
    Color Categories
      Null bytes
      Printable text
      Whitespace
      Non-ASCII bytes
    Installation
      Linux apt and dnf
      Homebrew macOS
      Cargo Rust
      Windows binary
    Use Cases
      Debug file formats
      Inspect binary data
      Find readable text
    Tech Stack
      Rust
      Terminal output
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Inspect a binary file format such as a PNG or compiled executable to see its raw byte structure with color coding.

USE CASE 2

Debug a corrupted file by viewing its hex content to quickly spot where readable text ends and binary garbage begins.

USE CASE 3

Learn how a file format encodes its header by viewing the first bytes with visual separation by byte type.

USE CASE 4

Quickly check whether an unknown file contains readable text strings embedded in binary data.

Tech stack

Rust

Getting it running

Difficulty · easy Time to first run · 5min
Dual-licensed MIT and Apache 2.0, use freely for any purpose, including commercial use, under whichever license you prefer.

In plain English

hexyl is a command-line tool for viewing the raw contents of any file in hexadecimal format. Hexadecimal is a way of displaying binary data that developers and low-level programmers use to inspect files at the byte level, which is useful when working with formats that are not plain text, debugging file corruption, or understanding how a program stores data on disk. The main thing hexyl adds on top of similar tools is color. It assigns different colors to different types of bytes: null bytes, printable text characters, whitespace, other ASCII characters, and non-ASCII bytes each get a distinct color. This makes it much easier to spot patterns or identify what parts of a file contain readable text versus binary data. The tool is written in Rust and is available through the package managers of most major Linux distributions, including Ubuntu, Debian, Fedora, Arch Linux, Void Linux, Gentoo, and FreeBSD. It is also available via Homebrew and MacPorts on macOS, and via Cargo (the Rust package manager) on any platform including Windows. Pre-built binary downloads are on the releases page for systems without a package manager option. The README is mostly an installation guide across different operating systems and package managers. There is no extended usage documentation in the README itself, though the tool ships with a manual page that can be generated from the included Markdown source using a tool called Pandoc. The license is dual Apache 2.0 and MIT, so you can use it under either.

Copy-paste prompts

Prompt 1
How do I install hexyl on Ubuntu 22.04 and use it to view the hex content of a binary file with color coding?
Prompt 2
Using hexyl, show me the command to view only the first 256 bytes of a PNG file so I can inspect its header structure.
Prompt 3
I want to find all printable text strings inside a binary file. How do hexyl's color categories help me identify them visually?
Prompt 4
How do I build hexyl from source using Cargo on Windows and view a binary file I want to inspect?
Prompt 5
Compare hexyl to the classic xxd tool, what does the color coding add and when should I prefer hexyl for my workflow?
Open on GitHub → Explain another repo

← sharkdp on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.