Text to Binary Translator
Translate text to 8-bit binary and back in UTF-8, byte for byte. Handles emoji, CJK and Python bin() output, and names the bad bit or byte instead of guessing.
- Runs in your browser
- Tool input is not uploaded to ZeroTool servers
- Free Β· No Sign-Up
Scan with WeChat to share this tool
Examples, details and FAQ Worked examples, how it compares with other tools, and answers to common questions.
Three Characters, Byte by Byte
The tool encodes text with UTF-8 (RFC 3629) and writes each byte as 8 bits. These are the tool's own outputs:
| Input | Code point | UTF-8 bytes | Binary output |
|---|---|---|---|
A | U+0041 | 41 | 01000001 |
δΈ | U+4E2D | E4 B8 AD | 11100100 10111000 10101101 |
π | U+1F600 | F0 9F 98 80 | 11110000 10011111 10011000 10000000 |
So "8 bits per character" is only true for ASCII. The first bits of each byte tell a decoder how long the character is: 0xxxxxxx is a one-byte character, 1110xxxx starts a three-byte character, 11110xxx starts a four-byte one, and every 10xxxxxx byte continues the character before it.
What looks like one character can be several code points. The family emoji π¨βπ©βπ§ is three emoji joined by two ZERO WIDTH JOINER characters (U+200D). The tool reports it as 1 character (5 code points) β 18 bytes of UTF-8, and the output contains 11100010 10000000 10001101 twice, once for each joiner. An accented letter typed as e plus a combining acute accent (U+0301) gives 01100101 11001100 10000001, while the precomposed Γ© (U+00E9) gives 11000011 10101001. Both look the same on screen. Characters are counted as grapheme clusters as defined in Unicode UAX #29.
Decoding Binary from Code and Homework
Binary copied from code often has no leading zeros. Python's bin() returns 0b1001000 for 72, and JavaScript's (72).toString(2) returns 1001000. This Python line gives 7-bit groups:
' '.join(format(ord(c), 'b') for c in 'Zero')
# '1011010 1100101 1110010 1101111'
Paste that into the Binary box and the tool returns Zero, with the note that 4 groups were read with leading zeros. The 0b form (0b1001000 0b1101001) decodes to Hi as well.
A group shorter than 8 bits counts as one byte only when no group is longer than 8 bits. If you paste a continuous stream that was wrapped at an odd place, such as 0100100001101001 followed by 01 on the next line, the tool stops at group 2 instead of turning 01 into a control character.
What the Error Messages Mean
Binary β Text either shows the whole text or shows no text and one message. Each case below is an input you can paste:
| Input | Message (shortened) |
|---|---|
01001000 0110100x | Character "x" at position 17 is not 0 or 1 |
010010000110100 | 15 bits is not a multiple of 8: the last byte has only 7 bits |
11100100 10111000 | Byte 1 starts a 3-byte UTF-8 character, but only 2 bytes of it are present |
10111000 | Byte 1 is a continuation byte (10xxxxxx) with no lead byte before it |
11101101 10100000 10000000 | Bytes 1β2 encode a UTF-16 surrogate, which UTF-8 does not allow |
The UTF-8 checks follow the byte ranges in RFC 3629 section 4: C0, C1 and F5βFF never occur, overlong forms are rejected, and so are surrogates (U+D800βU+DFFF) and values above U+10FFFF. The test suite compares the checker with the browser's TextDecoder in fatal mode on 20,000 random byte strings, and the two agree on every one.
Two cases need care even though text is shown. If the result contains C0 control characters other than tab and line breaks, or DEL, the status names the first one; C1 controls (U+0080βU+009F) are not counted. 00000000 01000001 is A in UTF-16 big-endian, and here it decodes to U+0000 followed by A, which is almost never what you want. If the bytes start with 11101111 10111011 10111111 (a byte order mark), the tool keeps it as U+FEFF without a warning, while a plain TextDecoder removes it silently (WHATWG Encoding, UTF-8 decode).
How It Compares with RapidTables
RapidTables was the first Google result for "text to binary" in the US on 2026-09-30. Its text-to-binary page gives the same UTF-8 bytes as this tool. We ran the same inputs through its Binary to Text converter with the default ASCII/UTF-8 setting on the same day:
| Input | RapidTables | This tool |
|---|---|---|
0100100001101001 (continuous) | i (the H is lost) | Hi |
01001000 0110100x | H4 | Error at position 17 |
11100100 10111000 (cut-off δΈ) | οΏ½ | Error at byte 1 |
1001000 1101001 (7-bit) | Hi | Hi |
RapidTables has options this tool does not: output in UTF-16 and in legacy encodings such as Shift JIS and GB 18030, and decimal, octal and hex output on the same page. For those number formats here, use the ASCII Converter or the Binary to Decimal & Hex Converter.
The Same Conversion in Code
const toBinary = (text) =>
[...new TextEncoder().encode(text)].map((b) => b.toString(2).padStart(8, '0')).join(' ');
toBinary('Hi'); // "01001000 01101001"
' '.join(f'{b:08b}' for b in 'Hi'.encode('utf-8')) # '01001000 01101001'
Limits
- UTF-8 only. The tool does not output UTF-16, Shift_JIS, GBK or EUC-KR. Bytes in those encodings are read as UTF-8, so they usually fail the check. ASCII-only UTF-16 without a byte order mark passes and shows NUL control characters with a warning; other UTF-16 without a BOM can pass as unrelated ASCII with no warning (U+4E2D is 4E 2D in UTF-16BE, which reads as
N-). - Binary digits only. Hex (
0x48), octal and decimal are rejected. Separators are spaces, tabs, line breaks, commas and semicolons; a period or a dash is an error. - Binary β Text runs on click. Text β Binary updates while you type. The other direction waits for the button or Ctrl+Enter, so half-typed bytes do not produce stray characters.
- Unpaired surrogates. A lone UTF-16 surrogate in the text cannot be encoded. It becomes U+FFFD (
11101111 10111111 10111101), and the status says how many were replaced. - Size. In Chromium on our test Mac, 87,500 characters of mixed Chinese, ASCII and emoji (175,000 bytes, about 1.57 million characters of spaced binary) convert in about 15 ms, and laying out the two boxes takes about 250 ms more. Decoding the same binary takes about 30 ms. The tool sets no size limit.
FAQ
How many bits does one character use?
It depends on the character. UTF-8 uses 1 to 4 bytes per code point, so A is 8 bits, precomposed Γ© is 16, δΈ is 24 and π is 32. An emoji built from several code points, such as the family π¨βπ©βπ§, is 18 bytes (144 bits). When you encode, the status line shows the character and byte counts, and adds the code point count when it differs from the character count, as with the family emoji.
Can I paste binary without spaces?
Yes. A group longer than 8 bits is cut into 8-bit bytes, so each such group must be a multiple of 8 bits long. When no group is longer than 8 bits, a group of 1 to 7 bits is read as one byte with leading zeros, so `1001000` decodes to `H`. Spaces, line breaks, commas, semicolons and 0b prefixes are also accepted between bytes.
Why do I get an error instead of text?
The tool shows text only when every group can be read as a byte and the bytes are valid UTF-8. Otherwise it names the problem: the character that is not 0 or 1 and its position, a group longer than 8 bits whose length is not a multiple of 8, a short group mixed with a longer one, or the byte where the UTF-8 is broken. It does not replace bad bytes with the οΏ½ character.
Why is the apostrophe in donβt 24 bits?
It is probably the curly apostrophe β (U+2019), not the ASCII ' (U+0027). Word and PowerPoint replace straight quotes with curly ones as you type, unless you clear "Straight quotes" with βsmart quotesβ under AutoCorrect Options βΊ AutoFormat As You Type. UTF-8 stores β in 3 bytes, 11100010 10000000 10011001; the ASCII apostrophe is one byte, 00100111.
Does it support UTF-16, ASCII 7-bit or other encodings?
Output is always UTF-8, which is the same as ASCII for the characters U+0000 to U+007F. Input groups shorter than 8 bits, such as 7-bit ASCII, are read as whole bytes when no group is longer than 8 bits. UTF-16, Shift_JIS, GBK and EUC-KR are not decoded as those encodings: their bytes are read as UTF-8, so they usually fail the check or turn into unrelated ASCII. ASCII-only UTF-16 without a byte order mark passes with NUL control characters and a warning; other UTF-16 without a BOM can pass as unrelated ASCII with no warning (U+4E2D is 4E 2D in UTF-16BE, which reads as `N-`).
Is my text sent to a server?
No. Encoding and decoding run in this browser tab with TextEncoder and TextDecoder; the text and the bits are not uploaded and are not saved in browser storage. The usage event records only the tool name and direction: text_to_binary after you commit an edit in the Text box or select a separator and encoding succeeds, and binary_to_text after a successful Binary β Text button or Ctrl/β+Enter action. Live typing does not record usage, and repeating an unchanged result for a direction is not counted again. Text and bits are not included.