Text to binary converter
Convert text to 8-bit or 4-bit binary per UTF-8 byte (optional 0b prefix, optional line wrapping), and turn binary bits back into text. Parsing tolerates spaces, newlines, commas and 0b prefixes, and rejects byte sequences that are not valid UTF-8. Runs entirely in your browser.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Result
The result depends only on the input and options; copy it to keep working.
Enter content to see the conversion
What this tool does
- Turn text into UTF-8 binary bits for C byte arrays, teaching demos or protocol debugging
- Recover readable text from binary bit dumps found in logs, captures or documentation
- Export nibbles (4-bit groups) or wrap the output at a fixed number of groups per line
Example
Input
AB
Output
01000001 01000010
Text is encoded as UTF-8 and each byte is padded to 8 bits before joining. Switch to "Binary → text" and paste this back to get AB.
Frequently asked questions
How many bits does a Chinese character take?
Chinese text is encoded as UTF-8, so a common character takes 3 bytes (for example 你 = 11100100 10111101 10100000), i.e. 24 bits. The tool only handles UTF-8 and does not convert GBK or GB18030.
The binary input is rejected — why?
Binary input may only contain 0 and 1, and the total number of bits must be a multiple of 8. Spaces, newlines, tabs, commas, semicolons and pipes all work as separators, leading 0b/0B prefixes are stripped, and 4-bit and 8-bit groups can be mixed. Any other character is reported as an error instead of being ignored.
Why does decoding say the bytes are not valid UTF-8?
Decoding uses strict mode: byte sequences that break the UTF-8 rules (such as a lone continuation byte 10111101) raise an error instead of printing replacement characters, so encoding problems stay visible.
Is my text uploaded, and how long can it be?
Nothing is uploaded; encoding and decoding happen in the browser. Text-to-binary emits 8 bits per byte, so long texts grow roughly eightfold in length (plus separators) — split them into chunks if needed.
Keywords:binarytxttoer