What does this tool do
The Text to Binary Converter converts plain text to binary (0s and 1s) and back. Encode any UTF-8 text to 8-bit binary per byte, or decode a binary string to plain text. Supports optional spacing between bytes for readability. All processing runs in your browser—no server upload.
How to use it
- Choose mode — Switch between Text → Binary (encode) and Binary → Text (decode).
- Set separator (encode only) — Choose "Space between bytes" for readable output, or "No separator" for a continuous string.
- Enter input — For encode: type or paste text. For decode: paste a binary string (0s and 1s; spaces are ignored).
- View output — The result appears after clicking Convert. Invalid binary shows an error.
- Copy — Use the copy button to copy the output to the clipboard.
How it works
Encode: The input is encoded to UTF-8 via TextEncoder, then each byte is converted to an 8-bit binary string (zero-padded). Bytes can be joined with or without spaces. Decode: Spaces are stripped from the input, which must contain only 0 and 1. The string is split into 8-bit groups, converted to bytes, then decoded to UTF-8 via TextDecoder. Invalid binary (wrong characters, length not divisible by 8, invalid UTF-8) returns an error. Input is limited to 500KB to avoid heavy main-thread work.
All computation runs entirely in your browser. No data is sent to any server.
Use cases & examples
- Learning — Understand how text is represented in binary.
- Encoding — Encode messages or data for transmission.
- Debugging — Inspect byte-level representation of strings.
- Education — Teach ASCII/UTF-8 and binary representation.
Example
- Encode
Hello→01001000 01100101 01101100 01101100 01101111(with space) - Encode
A→01000001(or01000001without separator) - Decode
01001000 01100101 01101100 01101100 01101111→Hello
Limitations & known constraints
- Input size — Maximum ~500KB (512,000 characters) to prevent browser slowdown.
- Encoding — UTF-8 only; other encodings (e.g. Latin-1) not supported.
- Binary format — 8 bits per byte; variable-length encodings (e.g. UTF-8 multi-byte sequences) are represented byte by byte.
- Empty decode — Empty input in decode mode returns an error.