hexview

The CLI tool "hexview" display file contents as hexadecimal, decimal or binary.

The starting position (as offset) and the length of the data to be read and output can be specified as integers. The output can be easily customized with simple options.

The start offset and length can be negative when processing a file. In this case, the offset and length are calculated from the end of the file. Example: If the file content is "abc1234567890", hexview with the options --start=-10 --length=-5 will process the characters "12345". Negative values are not permitted for standard input.

The size units KB, MB, GB, TB (decimal - 1 KB = 1000 bytes) and KiB, MiB, GiB, TiB or K, M, G, T (binary - 1 KiB = 1024 bytes) can also be specified. Invalid values or size units are ignored. Similarly, spaces, underscores, commas, and periods are ignored to simplify the input of larger numbers. Example: "1.234_kib", "1_234k" and "1.263.616" are all interpreted as 1263616 bytes.

Download

License:Freeware
Languages:English, German (readme only)
Characteristics:CLI, portable
Required:Windows 11
MacOS 26, Apple Silicon (ARM)

Downloadfor Windows • ZIP • 193 KB

Downloadfor MacOS • ZIP • 266 KB

Examples

Output of the last 64 bytes of a file:
%> ./hexview -s=-64 ./CLI.html
18EB: 6173 2061 2073 6570 6172 6174 6F72 3A20  as a separator: 
18FB: 3C63 6F64 653E 2D2D 706F 7369 7469 6F6E  <code>--position
190B: 3D2D 3130 3C2F 636F 6465 3E2E 3C2F 703E  =-10</code>.</p>
191B: 0A3C 2F62 6F64 793E 0A3C 2F68 746D 6C3E  .</body>.</html>
Output of a line from stdin as hexadecimal:
%> ./hexview --raw --no-groups
This is a long test text that was entered into the terminal as stdin...
546869732069732061206C6F6E672074
65737420746578742074686174207761
7320656E746572656420696E746F2074
6865207465726D696E616C2061732073
7464696E2E2E2E0A

Were the free content on my website helpful for you?
Support the further free publication with a donation via PayPal.

Read more about support options...