How to convert binary to text (and text to binary)
Binary looks like a wall of zeros and ones, but turning it into readable text is a simple, repeatable process. Once you see how one letter is stored, you can decode any message by hand, or let a converter do it in a click.
What binary actually is
Computers store everything as bits, and a bit is a single 0 or 1. Eight bits make a byte, and one byte is enough to store one English letter, digit or punctuation mark.
Binary is a number system with only two digits. In everyday decimal, each place is worth ten times the place to its right. In binary, each place is worth two times the place to its right.
Place values in one byte
Reading from left to right, the eight places in a byte are worth:
128 64 32 16 8 4 2 1Converting binary to text by hand
Take the binary 01001000 01101001 as an example. Each group of eight digits is one character.
- Split the binary into groups of 8 digits: 01001000 and 01101001.
- For each group, add up the place values that have a 1. For 01001000 the ones are in the 64 place and the 8 place, so 64 + 8 = 72.
- For 01101001 the ones are in the 64, 32, 8 and 1 places: 64 + 32 + 8 + 1 = 105.
- Look up each number in the ASCII table. 72 is the capital letter H and 105 is the lowercase letter i.
- Put the characters together: Hi.
Turning text into binary
Going the other way, find the number for each character, then write it as eight binary digits. The capital letter A is 65, which is 64 + 1, so it is 01000001. The lowercase letter a is 97, which is 64 + 32 + 1, so it is 01100001.
Notice that A and a differ by exactly one bit. Lowercase letters are always the uppercase code plus 32, which is why a single bit in the 32 place switches case.
The word Hello is 01001000 01100101 01101100 01101100 01101111. A space is a character too, and it is 00100000, which is 32.
What ASCII is
ASCII is the agreed table that gives each basic character a number from 0 to 127. Capital letters run from 65 (A) to 90 (Z), lowercase letters from 97 (a) to 122 (z), and digits from 48 (the character 0) to 57 (the character 9).
Be careful with digits. The character 5 is stored as the number 53, which is 00110101. That is not the same as the number five written in binary, which is 101.
Beyond English: UTF-8
ASCII has no room for accented letters, other alphabets or emoji. Modern text uses Unicode, and the most common way to store Unicode is UTF-8. It uses one byte for the ASCII characters and two, three or four bytes for everything else.
For example, the letter é is two bytes, 11000011 10101001. An emoji takes four bytes. This is why the binary for a short piece of non-English text can be much longer than you expect.
Common problems when decoding
- The number of digits is not a multiple of 8, so the groups do not line up. Check for a missing or extra digit.
- Spaces are in odd places. Most tools accept groups separated by spaces, or one long run of digits.
- The result is garbled symbols. The data is probably not text, or it uses a different encoding from the one you assumed.
- The characters look right for English but wrong for other languages. The text needs UTF-8 decoding, not plain ASCII.
Using the converter
The binary converter on Toolstia converts in both directions and also shows hexadecimal, decimal and octal. Paste your binary, pick the direction, and the text appears straight away. It runs in your browser, so nothing you type is uploaded.
If you want to see the raw bytes of a piece of text in hex, or look up the code number of a character, the text to hex converter and the ASCII converter do exactly that.