Text to Binary Converter
Convert text to binary, hex, octal, or decimal codes and back, with full Unicode support.
About this tool
What this text to binary converter does
This tool converts any text into its byte-level representation in binary, hexadecimal, octal, or decimal, and can also convert those codes back into readable text. Under the hood it uses the browser's built-in UTF-8 text encoder and decoder rather than a naive character-code lookup, which means accented letters, symbols, and emoji round-trip correctly instead of turning into garbled question marks — something a lot of simpler binary converters get wrong.
How to use it
- Choose a direction: "Text → Code" to encode, or "Code → Text" to decode.
- Pick a number base: binary, hexadecimal, octal, or decimal.
- When encoding, choose a separator (space, comma, new line, or none) between byte values.
- Type or paste your input, and the output updates instantly.
- Use the Swap Direction button to flip the current output back into the input and convert the other way.
Why binary, hex, and octal instead of just one?
Different fields favor different bases: binary is the closest to how computers actually store data and is common in computer science education, hexadecimal shows up constantly in programming (color codes, memory addresses, byte dumps), and octal still appears in Unix file permissions and some legacy systems. Having all three (plus plain decimal ASCII/Unicode codes) in one tool covers pretty much every reason someone would need to convert text into a numeric code.
Common use cases
- Computer science homework or coding bootcamp exercises on how text is stored as bytes.
- Decoding a binary or hex string found in a CTF challenge, log file, or old data dump.
- Understanding how a specific character (like an emoji or accented letter) is represented in UTF-8.
- Creating simple obfuscated or puzzle-style messages for fun.
Frequently asked questions
Does this handle emoji and non-English characters?
Yes — because it converts through UTF-8 byte encoding rather than a simple character-code table, multi-byte characters like emoji, Chinese characters, or accented letters (é, ñ, etc.) are encoded as multiple bytes and decode back into the exact original text.
What's the difference between binary, hex, octal, and decimal here?
They're just different number bases used to represent the same underlying byte values: binary uses only 0 and 1, octal uses digits 0-7, decimal uses 0-9, and hexadecimal uses 0-9 plus A-F. The tool pads binary to 8 digits, hex to 2 digits, and octal to 3 digits per byte so the output lines up predictably.
Why does converting code back to text sometimes show an error?
That happens when a value in your input isn't valid for the selected base (for example, entering "9" while the base is set to binary) or falls outside the 0-255 byte range. Double-check that you selected the correct base for the code you're pasting in.
Can I copy the output straight away?
Yes, click the Copy button next to the output box to copy the result to your clipboard in one click.
Is my text sent to a server?
No, all encoding and decoding happens locally in your browser using JavaScript's built-in TextEncoder and TextDecoder APIs. Nothing is uploaded.
