How the Text to Binary Converter Works
AnyTool converts text to binary entirely in the browser. It encodes the text to bytes with the native TextEncoder (UTF-8) or, in ASCII mode, one byte per character, then writes each byte in the chosen base — base 2 (binary), 8 (octal), 10 (decimal) or 16 (hexadecimal). Formatting options control the byte separator, zero padding to a fixed width, 0b/0o/0x prefixes and hex case. Decoding reverses the process: it splits the input on whitespace, commas, line breaks or fixed-width chunks, strips prefixes, parses each token in the base, and rebuilds the text with TextDecoder.
- Bytes come from the browser TextEncoder, so UTF-8 multi-byte characters are exact
- Output base 2, 8, 10 or 16 from the same underlying bytes
- Optional fixed-width padding (8 bits, 3 octal/decimal digits, 2 hex) and 0b/0o/0x prefixes
- Decoding tolerates spaces, commas, line breaks and prefixes, or chunks unseparated input
- All encoding and decoding is client-side JavaScript — no server round-trip
Two-Way Conversion and Error Handling
The converter is bidirectional and live: editing the text side encodes to the chosen base, while editing the code side decodes back to text, with the side you last touched driving the other. Invalid input is handled gracefully — a token with illegal digits, a value above 255, or a byte sequence that is not valid UTF-8 produces a clear inline message rather than corrupt output. Byte and character counts update as you type.
- Edit either side; the other updates instantly with no convert button
- Out-of-range values (above 255) and illegal digits are flagged inline
- Invalid UTF-8 byte sequences are caught and reported, not silently mangled
- US-ASCII mode warns when text contains characters above code point 127
- Live byte and character counts for the active side
Privacy and Offline Use
Because all conversion runs in the browser, the text and the encoded output never reach a server, there is no account or tracking, and the page works offline after first load. That makes it safe to convert confidential messages, keys or identifiers, and it stays fast because no data is transmitted.