binary
September 12, 2008 11:10 AM   Subscribe

How do I look at each byte of a file in binary in XP?

There are so many hex editors where I can see the hex representation of each byte, but where can I get one where I can see it in binary? I'm not really even concerned about editing the file, just looking at it in binary form.
posted by amsterdam63 to Computers & Internet (7 answers total)
 
What exactly are you trying to do? Do you need large chunks of the file to be shown in binary at once or just individual bytes?

For example, my hex editor of choice XVI32 has a Data Inspector window that shows various representations of a byte (including binary) when you click on a byte in the main window.
posted by burnmp3s at 11:25 AM on September 12, 2008 [1 favorite]


Response by poster: Ideally, it would just be a text file that gives the binary representations of each byte in a file. Like a text file with mmmm would look like this:

01101101
01101101
01101101
01101101
posted by amsterdam63 at 11:36 AM on September 12, 2008


The hex editor plugin to Notepad++ does this, but almost all hex editors should be able to do a binary display.
posted by demiurge at 11:55 AM on September 12, 2008


Do you have access to python?

import sys
for c in open(sys.argv[1], "rb").read():
bits = [(ord(c)>>bitpos) & 1 for bitpos in range(7,-1,-1)]
print "".join(map(str, bits))
posted by bonecrusher at 11:56 AM on September 12, 2008


OK - metafilter doesn't respect my indentation requests. Last two lines should be indented.
posted by bonecrusher at 11:57 AM on September 12, 2008


Indentation independent Python program.

import sys
for c in open(sys.argv[1], "rb").read(): print "".join(map(str, [(ord(c)>>bitpos) & 1 for bitpos in range(7,-1,-1)]))
posted by cmiller at 12:47 PM on September 12, 2008


Download this hexeditor.

View->Binary
posted by null terminated at 5:18 PM on September 12, 2008


« Older Straight as an arrow, flat as a pancake   |   The Web at my Fingertips Newer »
This thread is closed to new comments.