Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a hex file that I am attempting to convert to binary. I have performed this on Linux before using the command:

xxd -r -p mykey.hex > mykey.bin

But I cannot figure out how to do this same command on Windows. I have downloaded a few hex editor tools but not really sure how to use them to convert hex into a binary representation.

Is there a way to do this in Windows, or are there any similar tools out there that would allow me to do this?

share|improve this question

migrated from stackoverflow.com Nov 1 '12 at 19:51

This question came from our site for professional and enthusiast programmers.

    
I have attempted the similar once. I succeeded by turning the source into a javascript-escaped string with a regex and unescaping. –  Jan Dvorak Nov 1 '12 at 17:22

4 Answers 4

VIM 7.x contains xxd for Windows
I've uploaded xxd from there, here http://ge.tt/5jfutZq/v/0

C:\Program Files (x86)\Vim\vim74>.\xxd -v
xxd V1.10 27oct98 by Juergen Weigert (Win32)

C:\Program Files (x86)\Vim\vim74>dir xxd.exe
10/08/2013  12:33 PM            70,144 xxd.exe

Cygwin has one also

C:\cygwin\bin>.\xxd -v
xxd V1.10 27oct98 by Juergen Weigert

C:\cygwin\bin>dir xxd.exe
26/08/2014  12:00 AM            17,437 xxd.exe
share|improve this answer

There is a native port of xxd to Win32.

See unxutils here for downloads.

Another source of Win32 ports of common GNU and/or *nix utilities is GnuWin32.

share|improve this answer
    
I have downloaded this package but I do not see the xxd.exe anywhere in the package.. –  Kevin Nov 1 '12 at 17:40
    
My apologies. I swear that's where I fetched it from long ago. –  Greg Jandl Nov 1 '12 at 17:44
    
@Kevin, which one did you get and not find it in? It’s not in GnuWin32, it’s in the first paged that Greg linked to, in the table towards the middle of the page (just use your browser’s search function and type xxd). Also, typing xxd into the search-field of the GnuWin32 page brings up the reversable hexdump that it includes. –  Synetech Aug 30 '13 at 17:07
    
@Synetech interesting, didn't realise unxutils had xxd, so there's one thing it has that gnuwin32 doesn't! (gnuwin32 is often considered to have superceded it as unxutils has many old versions of programs, and gnuwin32 has so many more programs) –  barlop Oct 17 '13 at 21:27

If you are nuts, you could try processing the characters via input and then outputting the values 8 bits at a time using a programming language

share|improve this answer

Use this hex to bin converted: (works in browser, no software install necessary)

http://matrixstorm.com/avr/hextobin/ihexconverter.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.