Back to Electronics

Hex Viewer

Dec. 2023

Hex viewer example
Reading the contents of a file
Github Project

While working on a different project for one of my university classes, I found myself needing to examine files at a binary level. Usually, I would just download something that already exists and get on with my life, but I realized I didn't like many of the existing options for hex viewers. I decided it would be an interesting side project to develop my own.

I was using a Linux computer at the time, and I am just a big fan of C, so I decided to write my hex viewer in C. I wanted to avoid using third-party libraries or dependencies so I stuck with the standard C library. This was easy since a hex viewer is a relatively straightforward tool.

My requirements were therefore:

The resulting code ended up being just over 100 lines long, with an executable size of ~16 kB when compiled with GCC on Debian 12.