To convert binary to text, split the digits into 8-bit groups called bytes, turn each byte into a number by adding up its place values, and look that number up in the ASCII table. 01001000 is 72, the code for H, and 01101001 is 105, the code for i, so 01001000 01101001 spells Hi.
That works for English, where each character is one byte. Accented letters, other alphabets and emoji take two to four bytes each in UTF-8, the standard encoding for web pages, and those bytes must be read together. The free Binary Translator converts binary to text and text to binary in your browser, and shows the same bytes as hex or decimal.
How to convert binary to text with Zutilium
- Open the Binary Translator and paste the binary into the Text or binary box. Groups can be separated by spaces, tabs or line breaks, or run together with no separator at all.
- Leave Direction on Detect automatically. Input made only of 0s, 1s and whitespace, with at least eight digits, is read as binary, and the status line confirms it, for example "Detected binary. Decoded 2 bytes as UTF-8 text."
- Read the text in the Result box. If a message appears instead, it names the group or byte that is wrong; the troubleshooting section below explains each one.
- For text to binary, type or paste ordinary text. Each character becomes its UTF-8 bytes, written as eight 0s and 1s with a space between bytes.
- Under Show bytes as, choose Binary, Hexadecimal or Decimal for the encoded bytes. The setting applies only to text-to-binary output, because decoding always reads binary.
- Select Copy result, or Download result to save a .txt file. With binary output or decoded text, Use result as input swaps the result into the input box, which shows at once whether a message translates back exactly.
Compare the byte count in the status line with the characters you typed: "Hi π" reports 7 UTF-8 bytes for 4 characters, because the emoji takes four. To encode a string of 0s and 1s as characters, set Direction to Text to binary.
Text to binary takes up to 50,000 UTF-8 bytes at a time, and binary to text up to 500,000 characters of input. Everything runs in your browser, so nothing you type is uploaded.
How to read binary by hand
Each digit in a byte is a bit, and its position sets its value. From left to right, the eight positions are worth 128, 64, 32, 16, 8, 4, 2 and 1. Add the values of the positions that hold a 1, and you have the byte's number, from 0 to 255.
Place value 128 64 32 16 8 4 2 1
01001000 0 1 0 0 1 0 0 0 64 + 8 = 72 H
01101001 0 1 1 0 1 0 0 1 64 + 32 + 8 + 1 = 105 i
00100001 0 0 1 0 0 0 0 1 32 + 1 = 33 !
Then look up each number. ASCII gives codes 0 to 127 to English letters, digits, punctuation and control characters such as the line break, and UTF-8 uses the same codes for the same characters, so for English text the two produce identical binary. These landmarks cover most English messages:
| Character | Decimal | Hex | Binary |
|---|---|---|---|
| Line break | 10 | 0A | 00001010 |
| Space | 32 | 20 | 00100000 |
| ! | 33 | 21 | 00100001 |
| . | 46 | 2E | 00101110 |
| 0 to 9 | 48 to 57 | 30 to 39 | 00110000 to 00111001 |
| ? | 63 | 3F | 00111111 |
| A to Z | 65 to 90 | 41 to 5A | 01000001 to 01011010 |
| a to z | 97 to 122 | 61 to 7A | 01100001 to 01111010 |
Shortcuts for reading English binary
- The first three bits give the case. 010 starts a capital letter and 011 a lowercase one, and the last five bits are the letter's place in the alphabet: 01001000 ends in 01000, which is 8, so it is H, the eighth letter. The exceptions are symbols: 01000000 is @, 01100000 is a backtick, and endings from 11011 to 11111 give characters such as [ and {.
- Digits are 0011 plus the digit in four bits: 00110111 is 7.
- Capital and lowercase forms differ by one bit, the one worth 32: H is 01001000 and h is 01101000. If a decoded message arrives in the wrong case, the Text Case Converter fixes it without retyping.
- 00100000 is a space, so it shows where each word ends.
Text to binary: how characters become bytes
Writing text as binary runs the same steps backward: find the character's code, then subtract the largest place values that fit, writing 1 for each value used and 0 for each one skipped. Z is 90: 90 β 64 = 26, 26 β 16 = 10, 10 β 8 = 2 and 2 β 2 = 0, so the 64, 16, 8 and 2 positions get a 1, and Z is 01011010.
ASCII stops at 127. RFC 20 defines it as a 7-bit code carried in an 8-bit byte whose high-order bit is always 0, which is why every English character in binary starts with 0. Everything beyond it is handled by UTF-8, which RFC 3629 defines with one to four bytes per character:
| Character numbers | Bytes | Bit pattern | Covers |
|---|---|---|---|
| U+0000 to U+007F | 1 | 0xxxxxxx | ASCII |
| U+0080 to U+07FF | 2 | 110xxxxx 10xxxxxx | Γ©, Γ±, Greek, Cyrillic, Hebrew, Arabic |
| U+0800 to U+FFFF | 3 | 1110xxxx + 2 Γ 10xxxxxx | Chinese, Japanese, Korean, Hindi, β¬ |
| U+10000 to U+10FFFF | 4 | 11110xxx + 3 Γ 10xxxxxx | Most emoji, rare Chinese characters |
The x positions hold the character's number, and the fixed bits tell a decoder how to read each byte: a leading 0 marks a one-byte character, 110, 1110 or 11110 starts a character of two, three or four bytes, and 10 marks a continuation byte.
Take Γ©, character number U+00E9, or 233. That is above 127, so it needs the two-byte pattern and its 11 x positions. Write 233 in 11 bits, 00011101001, and fill the positions from left to right:
Γ© = U+00E9 = 233 = 00011 101001
110xxxxx 10xxxxxx -> 11000011 10101001 (hex C3 A9)
Multi-byte characters and emoji in binary
To decode a multi-byte character by hand, remove the marker bits from each byte, join what is left and read it as one number. Here is π, the waving hand emoji:
11110000 11110 | 000 starts a 4-byte character
10011111 10 | 011111 continuation
10010001 10 | 010001 continuation
10001011 10 | 001011 continuation
000 011111 010001 001011 = 1 1111 0100 0100 1011 = hex 1F44B = U+1F44B
An emoji that looks like one character is often several. Skin tones, the invisible selector that requests emoji style, flags and families each add code points, as Unicode's emoji standard defines:
| What you see | Made of | UTF-8 bytes |
|---|---|---|
| cafΓ© | c, a, f + Γ© | 5 |
| ΠΡΠΈΠ²Π΅Ρ | 6 Cyrillic letters | 12 |
| δ½ ε₯½ | 2 Chinese characters | 6 |
| β¬ | U+20AC | 3 |
| π | U+1F44B | 4 |
| β€οΈ | Heart + selector U+FE0F | 6 |
| ππ½ | Thumbs up + skin tone | 8 |
| π―π΅ | Regional indicators J + P | 8 |
| π¨βπ©βπ§ | Man, woman, girl + 2 joiners | 18 |
That is why a copied emoji can produce far more binary than expected, and why deleting a single byte breaks the character. Remove the joiners' bytes (11100010 10000000 10001101, twice) from the family and it decodes as three separate emoji. Decorative letters from font generators are separate Unicode characters too: a bold π is U+1D407, four bytes instead of the one byte of H, as the guide to copy and paste fonts explains.
Why binary code translators give different results
For English text, translators agree, apart from some that drop the leading 0 and write 7-bit ASCII. Beyond ASCII, the result depends on what a translator turns into bits, and there are three common choices:
| Method | Groups | π in binary |
|---|---|---|
| UTF-8 bytes | 4 Γ 8 bits | 11110000 10011111 10010001 10001011 |
| UTF-16 code units | 2 Γ 16 bits | 1101100000111101 1101110001001011 |
| Code point number | 1 Γ 17 bits | 11111010001001011 |
UTF-8 is what Zutilium, Python's encode("utf-8") and the browser's TextEncoder produce, and what the WHATWG Encoding Standard tells web authors to use. UTF-16 groups usually come from tools built on JavaScript's charCodeAt(), which returns UTF-16 code units rather than bytes. The split affects accents too: code-point tools write Γ© as the single byte 11101001, which strict UTF-8 decoders, Zutilium's included, reject.
Pasted into the Binary Translator, the UTF-16 version stops with "Byte 2 (00111101) does not continue the character started by byte 1" and the 17-bit version with "The input has 17 bits, which is not a whole number of bytes." If someone sent you binary made either way, decode it with the Python lines further down.
Hex and decimal: the same bytes, written shorter
Binary is long, so bytes are often shown in hex (base 16) or decimal instead. One hex digit stands for exactly four bits, so each byte is two hex digits: split 01001000 into 0100 and 1000, look up 4 and 8, and you get 48. Decimal is the 0 to 255 number from the place values.
| Bits | Hex | Bits | Hex |
|---|---|---|---|
| 0000 | 0 | 1000 | 8 |
| 0001 | 1 | 1001 | 9 |
| 0010 | 2 | 1010 | A |
| 0011 | 3 | 1011 | B |
| 0100 | 4 | 1100 | C |
| 0101 | 5 | 1101 | D |
| 0110 | 6 | 1110 | E |
| 0111 | 7 | 1111 | F |
Here is "Hi π" in all three forms, exactly as the Show bytes as setting writes them:
Binary 01001000 01101001 00100000 11110000 10011111 10010001 10001011
Hex 48 69 20 F0 9F 91 8B
Decimal 72 105 32 240 159 145 139
Hex makes UTF-8 easy to scan: 00 to 7F are ASCII, C2 to DF start two-byte characters, E0 to EF three-byte ones, F0 to F4 four-byte ones, and 80 to BF continue a character. The Binary Translator decodes binary only, so for hex input use the table above or the commands in the next section.
Two other codes are often mistaken for binary. Text made of letters, digits, + and /, often ending in =, is Base64: the Base64 Encoder & Decoder reads it, and the Base64 guide explains how it packs bytes into characters. Dots and dashes are Morse code, which the Morse Code Translator decodes and the Morse code alphabet chart lists.
Convert binary to text in Python, JavaScript or a terminal
Python 3:
bits = "01001000 01101001 00100000 11110000 10011111 10010001 10001011"
text = bytes(int(b, 2) for b in bits.split()).decode("utf-8") # 'Hi π'
" ".join(f"{b:08b}" for b in text.encode("utf-8")) # text to binary
bytes.fromhex("48 69 F0 9F 91 8B").decode("utf-8") # 'Hiπ' from hex
units = "1101100000111101 1101110001001011" # UTF-16 groups
b"".join(int(u, 2).to_bytes(2, "big") for u in units.split()).decode("utf-16-be") # 'π'
chr(int("11111010001001011", 2)) # 'π' from a code point
JavaScript, in a browser console or Node.js:
const bits = "01001000 01101001 00100000 11110000 10011111 10010001 10001011";
const bytes = Uint8Array.from(bits.trim().split(/\s+/), (b) => parseInt(b, 2));
new TextDecoder().decode(bytes); // "Hi π"
Array.from(new TextEncoder().encode("Hi π"), (b) => b.toString(2).padStart(8, "0")).join(" ");
A terminal on macOS, which includes Perl and xxd, or on Linux with both installed:
echo "01001000 01101001" | perl -lpe '$_ = pack "B*", join "", split' # Hi
printf 'Hi' | perl -ne 'print join(" ", unpack("(B8)*", $_)), "\n"' # 01001000 01101001
echo "48 69" | xxd -r -p # Hi, from hex
A common shortcut, calling String.fromCharCode(parseInt(b, 2)) on each byte, treats every byte as its own character. It works for ASCII but turns cafΓ© into cafΓΒ©; decoding all the bytes together, as above, keeps multi-byte characters intact.
Troubleshooting binary that won't translate
A group has 7 bits or another wrong length
"Group 2 (0110100) has 7 bits" means a digit is missing or extra: every group needs 8 digits, or a multiple of 8 when groups run together. Binary that drops leading zeros, such as 1001000 1101001 100001 for Hi!, mixes 6- and 7-digit groups, so pad each group on the left to eight digits: 100001 becomes 00100001. Input in which every group has exactly 7 digits is fine, because it is read as 7-bit ASCII.
Digits run together without spaces
An unbroken run has to divide evenly by 8, or you see "The input has 10 bits, which is not a whole number of bytes." Split it into groups of eight from the start and look for the group that breaks the pattern: in English text most bytes begin with 01, and spaces are 00100000.
Pasted binary comes back as more binary
Detection reads the input as binary only when it holds nothing but 0s, 1s, spaces, tabs and line breaks, with at least eight digits. Commas, 0b prefixes or a lone 7-bit letter make it text, which then gets encoded. Replace commas with spaces and delete the prefixes, or set Direction to Binary to text, which names the first character in the way: "Found β,β at character 9."
"These bytes are not valid UTF-8 text"
The digits form whole bytes, but not UTF-8. The rest of the message says why:
- "never appears in UTF-8 text": bytes 11000000, 11000001 and 11110101 to 11111111 are never used in UTF-8, so the data is probably not text at all, for example part of an image or a number.
- "starts a 3-byte character, but the input ends before the character is complete": the end was cut off when copying, or the text was encoded as Latin-1 or Windows-1252, where Γ© is the single byte 11101001.
- "does not continue the character started by byte 4": the same encoding mix-up in the middle of the text, or a flipped digit.
- "is a continuation byte, but no character started before it": the copy began partway through a character, so include the bytes before it.
For Latin-1 or Windows-1252 binary, decode in Python with .decode("cp1252") in place of .decode("utf-8").
The result has invisible characters
A note such as "It includes 2 invisible control characters, such as NUL (00000000)" usually means the binary came in 16-bit groups. UTF-16 writes H as 0000000001001000, which splits into a NUL byte and an H. Remove the first eight zeros of each 16-bit group, or use the UTF-16 lines in the Python example. Control characters scattered through the result suggest the data is not text.
Frequently asked questions
What does 01001000 01101001 mean?
It spells Hi. 01001000 is 72, the ASCII code for capital H, and 01101001 is 105, lowercase i. In hex the same two bytes are 48 69.
What is "I love you" in binary?
In ASCII or UTF-8 it is 01001001 00100000 01101100 01101111 01110110 01100101 00100000 01111001 01101111 01110101, ten bytes including two spaces. Case matters: the capital I is 01001001, while a lowercase i would be 01101001.
How many bits does one letter take?
An English letter, digit or punctuation mark takes 8 bits in ASCII and UTF-8; ASCII needs only 7, so the first bit is 0. In UTF-8, Γ© takes 16 bits, β¬ or a Chinese character 24, and most emoji 32.
Is binary to text the same as binary to decimal?
No. A binary to decimal converter reads all the digits as one number, so 1010 is 10. A text translator reads each group of 8 bits as a character code: the number 666 is 1010011010 in binary, while the text 666 is three bytes, 00110110 00110110 00110110.
Can any binary file be converted to text?
Only binary that encodes text. Images, audio and programs contain bytes that are not valid UTF-8, such as 11111111, or that decode to control characters, so a text translator rejects them or shows nonsense. Open such files in the program they belong to, or inspect their bytes as hex with xxd.