Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need a GUI application that shows the binary representation of text, using binary numbers, not hexadecimal numbers. Any suggestions?

For example, the program should convert the text Hi to 1001000 1101001.

I would prefer a graphical application to a command-line utility.

share|improve this question

4 Answers 4

up vote 6 down vote accepted
+50

After further consideration and removing my first answer, I now note that you don't want to see the readable text in a binary (e.g. with the strings utility), but see text in binary form.

So, I think the KDE utility, okteta is just what you want, and it is available in the repositories and can be installed with

sudo apt-get install okteta

It allows you to view text files in binary form (see the second screenshot below), and you can click the tab at the bottom of the page to switch between binary form, hexadecimal, decimal, and octal. You can even create a new file and start entering text and, if you have the binary mode selected, the characters typed will be shown in binary, just like in the online converter you linked to. The screenshot directly below shows an example of this:

enter image description here

This application does exactly what you have specified in the question, and it is a gui as well, so that seems to tick all the boxes.

Okteta seems to be the most fully featured editor available, and there are also modules and plugins that give additional functionality.

enter image description here

share|improve this answer
    
Amazing, stellar answer. Now I wish I had awarded a bounty. –  RolandiXor Dec 28 '12 at 20:13

You could try ppt from the bsdgames package. It will output ASCII as a binary punchcard.

You could also use a python script:

$ python -c 'for char in "Hello, world!": print(bin(ord(char)))'
0b1001000
0b1100101
0b1101100
0b1101100
0b1101111
0b101100
0b100000
0b1110111
0b1101111
0b1110010
0b1101100
0b1100100
0b100001
share|improve this answer
    
Thank you very much. An answer - at last. –  RolandiXor Dec 7 '10 at 3:36
    
Which one did you use, ppt, or python? –  kzh Dec 7 '10 at 15:19
    
Actually, a friend on this site is writing a wonderful application in python ^^ –  RolandiXor Dec 7 '10 at 15:25
    
+1 ppt is | oo .oo || ooo .o o|| oo o.oo || oo o.oo || oooo. o| ... The whole bsdgames package is a real blast from the past : –  Peter.O May 23 '11 at 17:52

I was wondering if od had the option to output as binary (vs. in hex with od -t x1z). Unfortunately not, but a good alternative is xxd found at U&L:

echo 'Hello, world!' | xxd -b
0000000: 01001000 01100101 01101100 01101100 01101111 00101100  Hello,
0000006: 00100000 01110111 01101111 01110010 01101100 01100100   world
000000c: 00100001 00001010                                      !.
share|improve this answer

GHex - a hex editor for GNOME

GHex allows the user to load data from any file, view and edit it in either hex or ascii.

Useful for debugging problems with object code or encodings.

Install via the software center ghex Install ghex

enter image description here

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.