DevToys Web Pro iconDevToys Web ProBlog
Rate us:
Try browser extension:

Text ↔ Binary Converter

Mode
Bits
Separator

Text

  • Binary

  • Technical details

    How the Text ↔ Binary Converter Works

    What the Tool Does

    The Text ↔ Binary tool converts text to and from its binary representation. At 8 bits per character the input is encoded as UTF-8 bytes; at 16 bits per character each code unit is emitted directly. Separators (space, comma, newline, or none) make the output easy to read or paste. Decoding accepts any combination of these separators and even strings of bits running together as long as the total length is a multiple of the configured bit-group size.

    Common Developer Use Cases

    Educators and students use the tool to visualize how ASCII and UTF-8 encode characters as bytes. Embedded developers prepare test fixtures of message payloads. Security analysts decode binary blobs copied from captures or reverse engineering writeups. It is also a quick sanity check when implementing your own bit-packing schemes or when explaining endianness and character encoding to a teammate.

    Data Formats, Types, or Variants

    At 8 bits per character, the tool round-trips text through UTF-8 so accented characters and CJK ideographs encode and decode correctly (e.g., 'é' becomes 11000011 10101001). At 16 bits per character, the tool emits UTF-16 code units, which is useful when matching how JavaScript represents strings internally. Separators are purely cosmetic — the decoder normalizes whitespace, commas, and newlines.

    Common Pitfalls and Edge Cases

    Mixing 8-bit and 16-bit groups in the same input produces incorrect output — pick one and stay consistent. UTF-16 surrogate pairs are emitted as two separate 16-bit groups; trying to decode them at 8 bits per character will not produce the original character. When decoding an unseparated bit string, the total length must be a whole multiple of the bit-group size or the tool will report an error.

    When to Use This Tool vs Code

    Use the browser tool for one-off conversions, classroom demos, and quickly preparing fixtures. In application code, use `TextEncoder` / `TextDecoder` for UTF-8 conversion, `Buffer.from(str, 'utf8')` in Node.js, or `bytes(str, 'utf-8')` in Python — these handle streaming, error modes, and BOM detection that a static converter does not.