Converting Among ASCII, Hex, and Binary

The Problem

I frequently have to convert data to different formats. I have used JavaScript converters that I've found online, but sometimes my files are huge.

I had a log file that was hundreds of megabytes containing hexadecimal characters.

01 23 45 67 89 AB CD EF

To analyze it I had to run it through a program that only accepts binary characters.

00000001 00100011 01000101 01100111 10001001 10101011 11001101 11101111

I decided to write a small set of programs to do this for me.

The Software

Click here for a zip file containing the source code, Win32 binaries, and Linux binaries.

Using the Software

First, save your file of data to be converted somewhere.

Using Converters 1

Then, click the file, ...

Using Converters 2

drag the file to the relevant converter binary, ...

Using Converters 3

and let go of the mouse button. A new file will appear in the same directory as the original file.

Using Converters 4

When you open the file, it should contain the converted data.

Using Converters 5

Additional Notes

When using hex2* or bin2*, white space is ignored.

*2hex and *2bin add a space after each byte. It's recommended that you modify the output file to suit your needs. I usually do this with a regex.

I haven't rigorously tested these files; use them at your own risk.

UPDATE (April 28, 2011): There is a new version of the software posted here.