Text to Binary: Differences, Edge Cases & Pitfalls
Convert text to 8-bit binary groups under UTF-8 or ASCII, with byte counts shown so size estimates stop being guesses.
Text to binary is just taking bytes per character under a chosen encoding: one byte per ASCII character, three bytes per CJK character in UTF-8, four per emoji. Length has nothing to do with how many glyphs you see, so size estimates must count bytes.
Format Differences
| Aspect | Text (characters) | Binary (bytes) |
|---|---|---|
| Unit | Characters (code points) | Bytes (groups of 8 bits) |
| Latin characters | 1 character | 1 byte (ASCII compatible) |
| CJK characters | 1 character | 3 bytes (UTF-8 variable length) |
| Emoji | One perceived "character" (multi-code-point) | 4 bytes; length counting is error-prone |
| Spaces and newlines | Visible whitespace | 0x20 and 0x0A, part of the encoding |
| Readability | Human readable | Not readable (all bits or hex) |
| Size | Small by character count | Same for ASCII, 2–4x larger for non-ASCII |
| Reversibility | The original | Fully reversible under the same convention |
Edge Cases
- Newlines differ per platform (LF vs CRLF), so normalise them before comparing binary strings across systems.
- Invisible characters (zero-width space U+200B, BOM U+FEFF) get encoded but render as nothing; check them when lengths disagree.
- Emoji are surrogate pairs in UTF-16, so grouping by "character" splits boundaries — work in code points or bytes.
- Mixing UTF-8 and UTF-16 conventions yields completely different bit strings for the same text; decode with the same one.
Common Pitfalls
- Treating the bit string as a number eats leading zeros and shifts every 8-bit group.
- Trimming trailing spaces or newlines on export makes the decoded text differ from the original.
- Estimating size by character count for CJK text understates it by three times.
- Decoding GBK-encoded Chinese as UTF-8 produces mojibake that nothing flags automatically.
Related Tools
- Text to BinaryConvert text to binary or back via UTF-8 encoding for ASCII and Unicode characters. Handy for low-level debugging, encoding tutorials and CTF puzzles.
- Data Format ConverterConvert between JSON, YAML, TOML, XML and CSV in one place with a single paste and instant preview for seamless multi-format config and data conversion.
- Text to NATO AlphabetConvert text to NATO phonetic alphabet (Alpha, Bravo, Charlie) for clear radio and phone communication. Spell out words letter by letter with confidence.
- Text to SpeechConvert text to speech using the Web Speech Synthesis API. Choose from available voices, adjust speed and pitch. Adjust rate pitch and voice and English text;.