Text to binary converter
Convert text to binary and binary back to text, with UTF-8 and Latin-1 support and clear errors. Nothing is uploaded.
About this converter
Text to binary and back is mostly a teaching and puzzle-solving tool - coursework, capture-the-flag challenges, the occasional protocol debugging session where you need to see the actual bytes. This converter runs in both directions and, unlike most, is explicit about the part that actually determines the answer: the character encoding.
That matters because "the binary for this text" is not a single well-defined thing. In UTF-8, an ASCII character is one byte, but an accented letter is two, a CJK character is three, and an emoji is four. In Latin-1 every character is exactly one byte, but anything beyond codepoint 255 cannot be represented at all. The same input produces genuinely different output depending on which you pick, and a tool that hides the choice is hiding the most important part.
Encoding to binary gives you eight bits per byte, optionally space-separated for readability. When UTF-8 produces more bytes than your text has characters, the converter says so and gives both counts - which is usually the moment the multi-byte behaviour becomes obvious rather than confusing.
Decoding is deliberately strict. Anything that is not a 0 or a 1 is ignored, so you can paste spaced, unspaced or newline-separated input. But a bit count that is not a multiple of eight is an error rather than a silent truncation, because a partial byte means something is genuinely wrong with the input and quietly dropping it produces plausible-looking nonsense. Byte sequences that are not valid UTF-8 also error rather than becoming replacement characters, with a suggestion to try Latin-1 if the data came from an older system.
Everything runs in your browser.
Frequently asked questions
- Why does my text produce more bytes than characters?
- UTF-8 uses one byte for ASCII but two to four for everything else. An accented letter, a CJK character or an emoji each take more than one byte.
- Why did decoding fail with "not a whole number of bytes"?
- Binary text needs a multiple of 8 bits. A different count means digits are missing or extra - usually a truncated copy and paste.
- When should I use Latin-1?
- When the data came from an older system that predates UTF-8. If decoding as UTF-8 errors but the input looks like one byte per character, Latin-1 is likely correct.