# hexyl

> Terminal hex viewer that colors bytes by category: NULL, printable ASCII, whitespace, other ASCII, and non-ASCII.

Stars: 10.3k · Language: Rust · License: Apache-2.0 · Categories: Dev Tools

- Repository: https://github.com/sharkdp/hexyl
- Page: https://www.trmn.sh/tools/hexyl

## Install

- Homebrew: `brew install hexyl`
- apt: `sudo apt install hexyl`
- Cargo: `cargo install hexyl`

## Overview

hexyl is a hex viewer for the terminal. It prints the bytes of a file or input as a hex dump with a file offset column, and uses colored output to distinguish five categories of bytes: NULL bytes, printable ASCII characters, ASCII whitespace characters, other ASCII characters, and non-ASCII bytes. This makes structure in binary data, such as runs of zeros or text embedded in binary, visible at a glance.

Colors are configurable through environment variables: HEXYL_COLOR_ASCII_PRINTABLE, HEXYL_COLOR_ASCII_WHITESPACE, HEXYL_COLOR_ASCII_OTHER, HEXYL_COLOR_NULL, HEXYL_COLOR_NONASCII, and HEXYL_COLOR_OFFSET. Values can be any of the 8 standard terminal colors, their "bright" variants (e.g. bright blue), or RGB hex such as #abcdef.

hexyl is written in Rust and is packaged for many platforms, including Debian/Ubuntu, Fedora, Arch, Void, Gentoo, macOS (Homebrew, MacPorts), the BSDs, Termux, Nix, Guix, snap, and Scoop. On Windows, it needs a terminal that supports ANSI escape sequences, such as Windows Terminal. It is aimed at developers, reverse engineers, and anyone inspecting binary files or data from the command line.

### Installation

```bash
# via Homebrew
brew install hexyl
```

```bash
# via apt
sudo apt install hexyl
```

```bash
# via Cargo
cargo install hexyl
```

![hexyl hex dump output](https://media.trmn.sh/cached/061dbfa67b52d20d84881cb56802d121fc9cbc366720a9a9dc7b25aa5bec1f67.png)

![hexyl byte category coloring](https://media.trmn.sh/cached/6e7d9927d4f443d26e6ccdeaa8ceb1bc9418725e7c772ef1803df6c25e868565.png)

## Alternatives

- [grex](https://www.trmn.sh/tools/grex.md): CLI tool that generates regular expressions from user-provided test cases automatically (Rust, 8.3k stars)
- [tailspin](https://www.trmn.sh/tools/tailspin.md): Log file highlighter (binary: tspin) that colors dates, numbers, IPs, UUIDs, URLs and more in any log format, with no config, and pages output through less. (Rust, 8.0k stars)
- [sd](https://www.trmn.sh/tools/sd.md): Find and replace CLI tool with regex support, string-literal mode, and faster performance than sed (Rust, 7.4k stars)
- [watchexec](https://www.trmn.sh/tools/watchexec.md): File watcher that runs commands when files change, with .gitignore support and cross-platform filesystem monitoring (Rust, 7.3k stars)
- [zizmor](https://www.trmn.sh/tools/zizmor.md): Static analysis tool that finds and fixes security issues in CI/CD configurations, including GitHub Actions workflows, Dependabot, and pre-commit. (Rust, 6.8k stars)

---

Canonical: https://www.trmn.sh/tools/hexyl
