Text to Binary
Convert text and bytes with UTF-8, UTF-16, Unicode code points, and flexible formatting.
How to use
- Choose Encode or Decode, then select UTF-8, UTF-16 BE/LE, or Unicode code points. Paste input or try Sample.
- For bytes, pick binary, hex, octal, or decimal. Encoding offers separators, matching prefixes, hex case, and zero padding. Binary groups can contain eight bits or four-bit nibbles.
- Decoding accepts whitespace, commas, and matching prefixes. Compact bytes require fixed widths; unseparated encoding always pads. Enable short values for a single unpadded binary/hex value.
- Invalid sequences show their byte position. Optional replacement uses U+FFFD and may lose information. Swap reverses direction using the result. Copy or download the output; input is never saved.
FAQ
How does ASCII to binary differ from Unicode conversion?
ASCII uses one UTF-8 byte per character. Other Unicode characters may need several bytes: 中 uses E4 B8 AD and 🚀 uses F0 9F 9A 80. UTF-16 represents 🚀 as a surrogate pair, shown here as four bytes. U+1F680 is its single Unicode code point, not a byte sequence.
How do I convert a string to bytes without separators?
Choose None as the separator. Binary uses eight digits per byte or two four-digit groups; hex uses two digits; octal and decimal use three digits. Padding stays on to preserve boundaries. With separators you can omit leading zeros. Unicode code points keep a U+ prefix on every value, so compact U+ output is unambiguous.
Why can binary to text fail, and what do the counts mean?
Bytes must form valid sequences in the chosen encoding. Strict mode reports the first malformed sequence; replacement mode inserts U+FFFD. UTF-16 still requires an even byte count. Character count means Unicode code points, not grapheme clusters. Byte count uses the selected encoding and counts the original bytes when decoding; code-point mode reports UTF-8 size. BOM characters are preserved, never added automatically.
How is this different from ASCII Table and String Escape?
Those tools already include basic UTF-8 byte conversion. This dedicated converter adds UTF-16 byte order, separators, prefixes, nibble grouping, padding controls and optional malformed-sequence replacement. Use ASCII Table to look up control names, and String Escape for language-specific string literals.