A simple, cross-platform hexdump utility written in C. It can print, save, or visualize the contents of binary files, and is easy to install on both Windows and Linux using the provided install scripts and prebuilt binaries.
- Print hexdump to terminal (
-t
) - Save hexdump to a text file (
-s
) - Visualize file as a color-coded image (
-v
, outputs PPM format) - Start reading from a specific byte offset (
-o <offset>
) - Limit output to the first N bytes (
-n <num>
) - Cross-platform: works on Windows and Linux
- Easy installation via
install.bat
(Windows) orinstall.sh
(Linux)
After installation, you can use hexdump
or hd
(on Windows) or just hd
(on Linux) from any terminal.
hexdump.exe -t [-o offset] [-n num] file.bin # Print hexdump to terminal
hexdump.exe -s [-o offset] [-n num] file.bin # Save hexdump to hexdump.txt
hexdump.exe -v file.bin # Visualize file as hexdump.ppm
-o <offset>
: Start at byte offset (e.g.,-o 512
)-n <num>
: Read only first N bytes (e.g.,-n 256
)
If you use Scoop, you can install directly from my bucket:
scoop bucket add mrmisra https://github.com/mrmisra/scoop-bucket
scoop install hexdump
- Download
install.bat
from the latest GitHub release. - Run
install.bat
as administrator.- The script will:
- Download the latest
hexdump.exe
from GitHub - Create
C:\Program Files\hexdump
- Place the exe in that folder
- Add the folder to your system PATH
- Create an
hd.bat
wrapper so you can usehd
as a shortcut
- Download the latest
- The script will:
- Download
hexdump.exe
from the latest release. - Copy it to a folder (e.g.,
C:\Program Files\hexdump
). - Add that folder to your system PATH for global access.
- (Optional) Create a batch file
hd.bat
in the same folder with:@echo off hexdump.exe %*
- Download
install.sh
from the latest GitHub release. - Make it executable and run it:
chmod +x install.sh ./install.sh
- The script will:
- Download the latest
hd
ELF binary from GitHub - Place it in
/usr/local/bin
(or another directory in your PATH) - Make it available as
hd
(to avoid conflict with the systemhexdump
)
- Download the latest
- The script will:
- Download the
hd
binary from the latest release. - Copy it to a directory in your PATH (e.g.,
/usr/local/bin
). - Make it executable:
chmod +x /usr/local/bin/hd
- The
-v
option creates ahexdump.ppm
image file. - Each byte is mapped to a color:
- Black: Null bytes
- Green: Printable ASCII
- Light gray: Whitespace
- Red: Control characters
- Blue: Other bytes
- Open the
.ppm
file with an image viewer that supports PPM (e.g., IrfanView, GIMP, or convert to PNG).
GPL-v3