DI Management Home > Utilities > HEXDUMP for Windows

Hexdump for Windows


The freeware Windows program hexdump.exe is a simplified version of the Linux utility to display file contents in hexadecimal.

Synopsis and example

>hexdump -h
Usage: hexdump [OPTION]... [FILE]
Display contents of FILE in hexadecimal.
With no FILE, read standard input.
 -C Canonical hex+ASCII display: add display of bytes as printable ASCII chars
 -H add ASCII display with escaped Html entities (e.g. '&' --> '&')
 -R add display of bytes in Raw format
 -V display version information and exit
 -h display this help and exit

>hexdump abc.txt
000000  61 62 63

>hexdump mexico-utf8.txt
000000  4f 6c c3 a1 20 6d 75 6e 64 6f 20 4d c3 a9 78 69
000010  63 6f 20 3c 26 3e 0d 0a 

Canonical hex + ASCII display

The original file is the string "Olá mundo México <&>" followed by a new line.

>hexdump -C mexico-utf8.txt
000000  4f 6c c3 a1 20 6d 75 6e 64 6f 20 4d c3 a9 78 69  Ol.. mundo M..xi
000010  63 6f 20 3c 26 3e 0d 0a                          co <&>..

Do for multiple files. Here are 3 different variants of encodings and line endings.

>for %f in (mexico*.txt) do @echo %f & hexdump -C %f
mexico-latin1.txt
000000  4f 6c e1 20 6d 75 6e 64 6f 20 4d e9 78 69 63 6f  Ol. mundo M.xico
000010  20 3c 26 3e 0d 0a                                 <&>..
mexico-utf8-bom-unix.txt
000000  ef bb bf 4f 6c c3 a1 20 6d 75 6e 64 6f 20 4d c3  ...Ol.. mundo M.
000010  a9 78 69 63 6f 20 3c 26 3e 0a                    .xico <&>.
mexico-utf8.txt
000000  4f 6c c3 a1 20 6d 75 6e 64 6f 20 4d c3 a9 78 69  Ol.. mundo M..xi
000010  63 6f 20 3c 26 3e 0d 0a                          co <&>..

In a batch file, replace %f with %%f.

Note:

Escape HTML entities in canonical display

>hexdump -H mexico-utf8.txt
000000  4f 6c c3 a1 20 6d 75 6e 64 6f 20 4d c3 a9 78 69  Ol.. mundo M..xi
000010  63 6f 20 3c 26 3e 0d 0a                          co &lt;&amp;&gt;..

Useful if you are copying and pasting into the source of an HTML web page. We use this option all the time when showing hexdump output in our web pages.

Display raw bytes

>hexdump -R mexico-latin1.txt
000000  4f 6c e1 20 6d 75 6e 64 6f 20 4d e9 78 69 63 6f  Olß mundo MÚxico
000010  20 3c 26 3e 0d 0a                                 <&>..

This displays the raw bytes on the right, which may not display so good on a Windows console, but you can redirect to a new file.

hexdump -R mexico-latin1.txt > mexico-latin1.out

Read from standard input

>type 1-23.txt
12345678901234567890123

>type 1-23.txt | hexdump -C
000000  31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36  1234567890123456
000010  37 38 39 30 31 32 33                             7890123

>echo abc |hexdump -C
000000  61 62 63 20 0a                                   abc .

Note the extra LF character added by echo in Windows (and the space between the 'c' and the '|').

Download

  1. Binaries: hexdump-2.0.0.zip (51 kB) [sha1=cf9dab2ade1a71ec9dd4497656fa54ee769cb0db]. The latest version is 2.0.0 signed on 2017-07-02.

Install

To install, just copy the file hexdump.exe to a folder on your Windows PATH, for example C:\Windows. You may need administrator permissions to copy the file.

Contact us

To report a bug, comment on this page or to contact us, please send us a message.

This page last updated 4 July 2017.