Binary to Text Converter
Binary to text converter: every group of eight bits is one byte, and each byte is looked up as a character, so 01001000 01101001 reads Hi. Paste binary with or without spaces, or switch to text to binary. UTF-8 and ASCII work, and a wrong bit count is reported instead of guessed.
How binary becomes text
Text on a computer is a list of numbers, and binary is the way those numbers are written down. Each character has a number in a character set, the number is stored in one or more bytes, and a byte is eight bits. To turn binary back into text you reverse those three steps: cut the bits into bytes, read every byte as a number, and look each number up in the character set. The binary to text converter above does that as you type and shows the result in the output box.
The two bytes in the picture are 01001000 and 01101001. The first is 72, which is the capital letter H in ASCII and in UTF-8, and the second is 105, a lower case i. Nothing in the bits themselves says they are letters: the same two bytes are the number 18,537 when read as one 16-bit value, or two pixel brightness levels in an image. The reading is a choice, and for text the choice is made by the character encoding, UTF-8 being the default on the web.
Reading a byte by hand
You can decode a short message with nothing but the place values. The eight positions of a byte are worth 128, 64, 32, 16, 8, 4, 2 and 1 from left to right. Add the values of the positions that hold a 1. In 01001000 the 1 bits are at 64 and 8, which give 72. Look 72 up in the ASCII table and you find H.
For a letter there is a shortcut. Every capital letter starts with the bits 010 and every lower case letter with 011, so the first three bits tell you the case, and the last five bits count through the alphabet: 00001 is the first letter and 11010 is the 26th. 01001000 is therefore a capital (010) followed by 01000, which is 8, the eighth letter: H. The case bit is the reason that adding 32 turns a capital letter into its lower case twin, and it is why 01100101 (e) differs from 01000101 (E) in a single bit.
Binary for common characters
These are the bytes you meet most often when you decode messages. The decimal number is the value of the byte, and the hex column is the shorter way to write the same eight bits.
| Character | Decimal | Hex | Binary |
|---|---|---|---|
| A | 65 | 41 | 01000001 |
| B | 66 | 42 | 01000010 |
| Z | 90 | 5A | 01011010 |
| a | 97 | 61 | 01100001 |
| b | 98 | 62 | 01100010 |
| z | 122 | 7A | 01111010 |
| 0 | 48 | 30 | 00110000 |
| 9 | 57 | 39 | 00111001 |
| space | 32 | 20 | 00100000 |
| ! | 33 | 21 | 00100001 |
| ? | 63 | 3F | 00111111 |
| @ | 64 | 40 | 01000000 |
| ~ | 126 | 7E | 01111110 |
Two patterns are worth remembering. The digits 0 to 9 are 00110000 to 00111001, so a digit's low four bits are the digit itself. A space is 00100000, a single 1 in the 32 position, which is why it is the easiest byte to spot in a long stream of bits. The complete table of all 128 codes, with the control characters, is on the ASCII table page.
Text to binary
The opposite direction starts from the characters. Each one is converted to its byte or bytes in the chosen encoding, and every byte is written as eight binary digits, padded with zeros on the left. The word Hello becomes 01001000 01100101 01101100 01101100 01101111. The converter has a second mode for this, reached with the Text to binary button, and the Swap button moves the current output to the input and flips the direction, so you can check a round trip in one click.
There are two ways to lay the bits out. With a space between bytes each group of eight is easy to read and easy to copy into a decoder. Without spaces the output is one long string, which is what some assignments and puzzles ask for. The checkbox next to the encoding switches between the two. Either form decodes back to the original text, because a run of bits with no separators is simply cut into bytes of eight from the left.
Binary to ASCII
ASCII has 128 characters and needs seven bits, so a binary to ASCII conversion is a binary to text conversion in which the first bit of every byte is 0. That is why English text in binary looks so regular: every group begins with 0, and capital letters begin with 01. The two readings agree for every byte below 128, and UTF-8 was designed that way, so ASCII text is also valid UTF-8 and the converter needs no separate switch for it.
Some examples and textbooks write ASCII in groups of seven, such as 1001000 1101001 for Hi. The converter detects this: when every group has exactly seven bits it adds a leading zero to each and says so in a note under the boxes. The ASCII encoding in the selector is stricter than UTF-8, because it reports any byte above 127 as an error and never guesses a meaning for it. Use it when the data is supposed to be plain ASCII and you want to find the stray byte that is not.
Older material sometimes uses the eighth bit as a parity bit, which is a check bit added so that the number of 1 bits is always even or always odd. A parity byte for H, 01001000, has two 1 bits, so even parity leaves the top bit at 0, while the letter C, 01000011, has three 1 bits and gets a leading 1 under even parity. If you decode such data and see capital letters turning into bytes above 127, strip the parity bit first by clearing the top bit of each byte. The converter does not do this, since there is no marker that distinguishes parity from a genuine high byte.
Characters outside ASCII
Letters with accents, currency signs, Asian scripts and emoji do not fit in one byte. UTF-8 stores them in two, three or four. The first byte says how many bytes the character has, by the number of leading 1 bits, and the rest are continuation bytes that always begin with 10. Reading binary text that contains these characters therefore works only if the converter decodes the bytes together, which is what the UTF-8 setting does.
| Character | Code point | Bytes in binary | Pattern |
|---|---|---|---|
| é | U+00E9 | 11000011 10101001 | 110xxxxx 10xxxxxx |
| € | U+20AC | 11100010 10000010 10101100 | 1110xxxx 10xxxxxx 10xxxxxx |
| 語 | U+8A9E | 11101000 10101010 10011110 | 1110xxxx 10xxxxxx 10xxxxxx |
| 😀 | U+1F600 | 11110000 10011111 10011000 10000000 | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx |
If you cut such a text into single bytes and look each up in the ASCII table you get nonsense, which is the usual reason for strange characters in a result. When an input does not decode cleanly, the converter marks the broken byte with a replacement character and lists the position in the message under the boxes.
Choosing the encoding
UTF-8 is the right choice for almost all binary text today. The other encodings in the selector exist because the same bits can mean different things. Take the byte 11101001, which is E9. In Latin-1 and Windows-1252 it is the letter é. In UTF-8 it is the first byte of a three-byte character, and when the next two bytes are not continuation bytes the sequence is invalid. A binary string from an old system that decodes badly as UTF-8 often decodes well as Windows-1252, and the reverse happens when a modern UTF-8 file is shown with the wrong setting.
UTF-16 stores most characters in two bytes and is the native string format of JavaScript and Windows. If binary text decodes as every second character being a zero byte, or the output looks like letters separated by blank squares, the data is UTF-16 and the selector should be set to UTF-16 LE or BE. LE puts the low byte first and is the Windows default; BE puts the high byte first. When the encoding is unknown, try UTF-8, then Windows-1252, then UTF-16, and keep the reading that produces words. The auto decoder makes the same kind of guess for pasted strings of unknown format.
Input the binary converter reads
Input is forgiving about layout and strict about content. Groups can be separated by spaces, commas, underscores, dashes or line breaks, or not separated at all. A leading 0b is dropped. Digits other than 0 and 1 are errors and the message gives the character and its position, counting from 1, with a Show button that moves the cursor there.
01001000 01101001
01001000,01101001
0100100001101001
0b01001000 0b01101001
01001000
01101001When the groups are of different sizes, for example 1001000 and 01101001, they are joined into one bit string and cut into bytes of eight from the left, and a note tells you so. This is the right reading for a stream and usually the wrong one for loosely typed data, so check the output when you see that note.
When the bit count is wrong
The most common failure is a bit count that is not a multiple of eight. The converter decodes the whole bytes it has and reports the leftover: for example, 01001000 011 gives H and the message that the last 3 bits (011) cannot form a byte. It does not pad the leftover to a byte, because padding on the left and on the right give different characters, and only you know which is right.
There are three usual causes. The first is lost leading zeros: a number printed with toString(2) or a similar function drops zeros on the left, so the letter A comes out as 1000001, seven bits. The fix is to pad every group to eight, or to feed the converter groups of seven and let it widen them. The second is a copy that missed the first or last character of a long string; compare the length with what you expected, which is eight times the number of characters for ASCII. The third is text that is not meant to be read as bytes at all, such as a 32-bit integer or an IPv4 address in binary, where the grouping carries a different meaning.
Binary translators and binary decoders
Search results use several names for this tool: binary translator, binary decoder, binary code translator, binary to English. They all describe the conversion on this page, with one difference in scope. A binary translator usually works in both directions, so the converter here has both a Binary to text and a Text to binary mode. A binary decoder is the one-way direction from bits to characters. Some pages with those names list the decimal number of each byte instead of the character, which is a binary to decimal conversion, and the binary to decimal page covers that case with the working shown.
Binary is not a language. There is no dictionary of binary words and no translation of meaning, only a reversible change of notation. A message such as 01001000 01101001 is the text Hi written in a different alphabet of two symbols, in the same way that Morse code is the text written in dots and dashes.
Binary that is not text
Not every string of 0 and 1 is a message. A binary file, such as a program, an image or a document, is bytes too, but its bytes follow the format of the file and not the rules of a character set, so decoding it as text produces a mix of letters and control characters. The give-away is a result full of replacement characters and unprintable symbols, or one that starts with a recognisable file marker such as MZ for a Windows program or %PDF for a document. To look at those bytes, convert them to hex with the hex to binary and binary to hex pages, or paste the bits into the auto decoder, which names file types from the first bytes.
A binary number can also be a value. The 32 bits 11000000 10101000 00000001 00000001 are the IPv4 address 192.168.1.1, four numbers of eight bits each, and have no connection to a text. The same goes for a 16-bit colour value or a register in a datasheet. For these, the useful conversions are binary to decimal or binary to hex, and the converter here is the wrong tool.
Binary to text in code
All of this is a few lines in any language. The examples below were run before they were put on the page.
const bits = "01001000 01100101 01101100 01101100 01101111";
const bytes = Uint8Array.from(bits.split(" "), (b) => parseInt(b, 2));
console.log(new TextDecoder("utf-8").decode(bytes)); // Hello
// Text to binary
const out = Array.from(new TextEncoder().encode("Hi"), (b) => b.toString(2).padStart(8, "0"));
console.log(out.join(" ")); // 01001000 01101001for b in 01001000 01100101 01101100 01101100 01101111; do
printf "\x$(printf '%02x' $((2#$b)))"
done; echo
# Hello-join ("01001000 01100101 01101100 01101100 01101111" -split " " |
ForEach-Object { [char][Convert]::ToInt32($_, 2) })
# Hello
[Text.Encoding]::UTF8.GetBytes("Hi") |
ForEach-Object { [Convert]::ToString($_, 2).PadLeft(8, "0") }
# 01001000
# 01101001The JavaScript version uses TextDecoder, which handles UTF-8 correctly, while the Bash and PowerShell lines treat each byte as a single character and so are right for ASCII only. For text with accents or other scripts, decode the collected bytes with a UTF-8 decoder in the same way the first example does.
Decode a message yourself
Here is a short message to decode by hand before you paste it into the converter. The six bytes below spell a single word. Convert each byte to its number with the place values, then find the number in the ASCII table: the first is 66, the capital letter B, and the rest are lower case.
| Binary | Decimal | Hex | Character |
|---|---|---|---|
| 01000010 | 66 | 42 | B |
| 01101001 | 105 | 69 | i |
| 01101110 | 110 | 6E | n |
| 01100001 | 97 | 61 | a |
| 01110010 | 114 | 72 | r |
| 01111001 | 121 | 79 | y |
Once you can do this for a few letters, longer messages are only a matter of patience, and the converter is for the cases where you do not want to spend it. It also helps to recognise the frame of English text: the bytes start with 0, nearly all letters start with 01, and a space is 00100000, so a gap of that shape between groups of letters marks the end of a word.
Checking a result
Two quick checks find most mistakes. First, count: the number of bits divided by eight is the number of bytes, and for ASCII text that is also the number of characters. The status line under the input shows both numbers. Second, run the output through the converter in the other direction. If the Text to binary mode returns your original bits, with the same grouping, the conversion is exact, whatever the bits were meant to be.
The tool decodes and encodes inside your browser and sends nothing to a server, so you can paste private text. The text to hex and hex to ASCII converters give the same bytes in hex, which is shorter to read, and the hex decoder is the place to go if the data arrives in that form.
Questions about binary to text
How do I convert binary to text?
Split the bits into groups of eight, read each group as a base-2 number, and look the number up as a character. 01001000 is 72, which is H, and 01101001 is 105, which is i, so 01001000 01101001 reads Hi. The converter does the grouping, the arithmetic and the lookup.
How many bits make one letter?
Eight bits, one byte, for every ASCII letter. ASCII itself needs only seven bits, so the first bit of each byte is 0 for plain English text. Characters outside ASCII take two to four bytes in UTF-8, which is 16 to 32 bits.
Why does my binary give strange characters or question marks?
Either the bits are cut at the wrong place or the wrong encoding is selected. Check that the number of bits is a multiple of eight, and try UTF-8 first. Bytes above 127 are only text in a specific encoding, and the same bits read as Latin-1 give different characters than as UTF-8.
Can I decode binary without spaces?
Yes. A run of 0 and 1 is cut into bytes of eight from the left, so 0100100001101001 reads Hi. If the length is not a multiple of eight, the converter says how many bits are left over instead of guessing where the missing zeros belong.
What is the difference between binary to text and binary to decimal?
Binary to text turns each eight-bit group into a character through an encoding. Binary to decimal reads the whole bit string as a single number. The same bits, 01001000, are the letter H in the first reading and the number 72 in the second.
