Text to Binary — Convert Text to Binary Code with Hex
Convert text to binary code — each character as 8-bit representation with hexadecimal alongside. Runs in your browser, no data leaves your device.
Text to Binary
Convert text to binary representation. Each character is shown as 8-bit binary with hex and ASCII labels. Perfect for learning binary encoding. Works entirely in your browser.
Binary is the native language of every digital system. Every character you type, every pixel on screen, every packet on the wire is ultimately a sequence of bits. The Text-to-Binary converter renders text at that lowest level: each character becomes its 8-bit byte representation, displayed as a string of zeros and ones with the hexadecimal equivalent alongside. The output is the same format that protocol specifications use to define wire formats, that hex editors use to display memory dumps, and that computer science textbooks use to teach encoding. The three-column layout — character, binary, hex — makes the mapping explicit, which is useful for debugging character encoding issues, teaching the relationship between binary and hexadecimal, or inspecting what a non-ASCII character looks like as UTF-8 bytes.
The conversion uses the UTF-8 encoding, which is the universal text encoding of the web. ASCII characters (A–Z, 0–9, punctuation) produce a single byte with the leading bit zero — visually distinguishable from multi-byte sequences where the leading bits follow the UTF-8 prefix pattern (110xxxxx, 1110xxxx, 11110xxx). Characters outside ASCII — accented letters, Greek and Cyrillic script, CJK ideographs, emoji — produce two to four bytes, and the converter shows every byte in sequence. The reverse mode accepts binary strings in any spacing convention and reconstructs the original UTF-8 text, so the tool is a complete round-trip encoder-decoder for the binary representation of text.
How to use
Enter your text
Type or paste the text. The converter displays three representations side by side: the original character, the 8-bit binary value, and the hexadecimal equivalent. Spaces separate bytes for readability.
Choose a byte grouping
Select between space-separated (readable), no separator (compact, for machine parsing), or 8-byte groups with line breaks (for comparing blocks). The hex output can be displayed as lowercase, uppercase, or prefixed with 0x.
Copy the result
Copy the binary string, the hex string, or both. The binary output is valid input for the companion Text to Binary tool's reverse mode — decode back to text in one click.
Frequently asked
What encoding does the conversion use?
UTF-8. Each character is encoded to its UTF-8 byte sequence, and each byte is displayed as 8 binary digits. For ASCII characters (code points 0–127), this produces a single byte. For non-ASCII characters (accented letters, emoji, CJK), the output is the multi-byte UTF-8 encoding — 2 to 4 bytes per character.
Why 8 bits per byte instead of 7?
Modern computers use 8-bit bytes (octets). The leading bit is always shown even for ASCII characters where it is zero — this keeps the output consistently byte-aligned and matches how bytes are represented in memory, network protocols, and hex dumps.
Is the binary output big-endian or little-endian?
Within each byte, the most significant bit is on the left (big-endian bit order). This matches the standard written representation of binary numbers and the bit numbering in protocol specifications. For multi-byte sequences, the bytes appear in transmission order (network byte order).
Can it convert binary back to text?
Yes — the reverse mode accepts space-separated or concatenated binary strings and decodes them to UTF-8 text. Paste binary from any source (logic analyser output, protocol dump, educational exercise) to recover the original text.
Limitations
- No arbitrary encoding supportThe conversion is UTF-8 only. For legacy encodings like ISO-8859-1, Shift-JIS, or EBCDIC, use the Charset Converter tool to normalise to UTF-8 first, then convert to binary.
- No bit-level manipulationThe tool converts bytes to binary representation but does not support bitwise operations (AND, OR, XOR, shifts) on the binary data. Use a hex editor or a programming language for bit-level manipulation.
- Large text performanceFor texts over 100 KB, the live-update binary display may become slow. Copying the binary output is still instant; the rendering is the bottleneck for very large inputs.
Platform notes
- macOS
- The terminal equivalent is `xxd -b file.txt` for hex-and-binary dump, or `echo -n 'text' | od -An -tx1` for hex bytes. The browser tool shows character-level alignment that terminal dumps do not.
- Linux
- `xxd -b` and `hexdump -C` are the standard binary-viewing tools. The browser tool is the right pick for a formatted, character-aligned view without piping through multiple commands.
- Web
- Runs entirely client-side. The text is converted in the browser with the TextEncoder API — no data is transmitted for conversion.