Text to Binary Converter

Encode text into binary code (0s and 1s) or decode binary back to readable text. Supports hex, octal, and decimal.

Output

Some characters occupy multiple bytes in UTF-8. For example, the Euro sign is 3 bytes (E2 82 AC), and most emoji are 4 bytes. This tool processes text by codepoint, which ensures that multi-byte characters can be reliably converted back to text.

When the separator is set to None, the input code is parsed in chunks: 8 digits for binary, 3 for octal and decimal, and 2 for hexadecimal. If the total number of digits is not a multiple of the corresponding chunk size, it cannot be converted back to text.

What is the Text to Binary Converter?

Convert text into a binary string of 0s and 1s, or decode binary data back into human-readable text. This tool goes beyond simple binary, offering conversions for octal, decimal, and hexadecimal as well. It automatically detects whether you're converting from text or code, providing instant results as you type. All processing happens exclusively in your browser, guaranteeing that your data remains private. It’s free, requires no installation, and includes a detailed breakdown table showing how each character is encoded—perfect for learning and debugging.

How to use

  1. Paste your text or code into the “Input (text or code)” box. Click “Insert example” to see a quick demonstration.
  2. The conversion direction defaults to “🔄 Auto-detect”. You can also manually set it to “Text → Code” or “Code → Text”.
  3. Choose your target number system: “Binary”, “Octal”, “Decimal”, or “Hexadecimal”.
  4. Customize the output with options for “Separator” (e.g., Space, Comma), grouping by bytes with “Group by”, or adding a “Prefix (0b/0o/0x)”.
  5. The converted result appears live in the “Output” field. Use the “Copy” or “Download” buttons to save your result.
  6. Review the “Per-character details” table below for a byte-by-byte analysis of the conversion.

Text to Binary Converter guide

How this tool is used in real work, and what to watch out for.

How Computers Store Characters

Computers don't really understand "characters." They only understand numbers. An encoding is a system that maps those numbers to characters. This tool breaks down that entire process for you.

The sequence is: Character → Unicode Codepoint (the number starting with U+) → UTF-8 byte sequence → each byte represented in the chosen base. The four columns in the per-character detail table correspond exactly to these steps.

CharCodepointUTF-8 BytesBinary
AU+004141 (1 byte)01000001
U+AC00EA B0 80 (3 bytes)11101010 10110000 10000000
U+D55CED 95 9C (3 bytes)11101101 10010101 10011100
😀U+1F600F0 9F 98 80 (4 bytes)11110000 10011111 10011000 10000000
This is why the "Characters" and "UTF-8 bytes" counts in the statistics can differ. For English letters it's a 1:1 ratio, but for Korean characters it's 1:3, and for emoji it's 1:4.

Why Korean Characters are 3 Bytes, and the Real-World Problems It Causes

UTF-8 is a variable-width encoding. Characters in the ASCII range (U+0000–U+007F) are kept at 1 byte for compatibility with legacy English data, while characters that come after use 2, 3, or 4 bytes. Korean syllables (U+AC00–U+D7A3) fall into the 3-byte range, and most emoji (U+10000 and above) are in the 4-byte range.

In code, this difference shows up in several ways:

  • MySQL's older `utf8` character set (also known as `utf8mb3`) can only store a maximum of 3 bytes per character. This works for Korean, but trying to store an emoji results in an "Incorrect string value" error. You need to use `utf8mb4` to fix this.
  • Column length limits can be based on either bytes or characters, leading to different results. For example, an Oracle `VARCHAR2(10 BYTE)` column can only hold 3 Korean characters.
  • Limits like API request body size or the 4KB cookie limit are always byte-based. If your text includes Korean characters, you'll hit the limit at what feels like one-third of the expected character count.
The 90-byte limit for standard SMS messages in South Korea is based on the EUC-KR encoding, not UTF-8. In EUC-KR, a Korean character is 2 bytes (allowing 45 characters). This is different from the UTF-8 byte count shown by this tool, so do not use it to calculate character limits for Korean SMS.

How 'Broken' Characters (Mojibake) Happen

Character encoding errors don't mean the data is corrupt; they happen when the same sequence of bytes is read using the wrong lookup table. If you take Korean text saved as UTF-8 and try to read it as CP949 (the Korean Windows encoding), you'll get gibberish. If you do the reverse, you'll see question marks or empty squares (□). The bytes are identical; only the interpretation is wrong.

You can see this happen directly in this tool. If you try to convert code back to text with the wrong base selected, you'll get a "Byte array cannot be interpreted as UTF-8 characters" error. This is because the byte sequence doesn't follow the structural rules of UTF-8, so the decoder rejects it outright.

If you look at the binary column in the table above, you can see a pattern. A 3-byte Korean character always starts with bytes beginning with `1110`, `10`, and `10`. This structure allows decoders to find character boundaries even when starting in the middle of a byte stream, and to immediately identify invalid data that doesn't fit the pattern.

Settings That Affect Reversibility: Separators, Base, and Prefixes

You can generate code with any settings, but to convert it back, the byte boundaries must be clear. If you set the `Separator` to 'None', the code is parsed by digit count, so the total number of digits must be an exact multiple of the chunk size for that base.

  • The `Prefix` option is ignored if the `Separator` is set to 'None'. Adding prefixes like `0b` without a separator would make the byte boundaries impossible to recover, so they aren't added in the first place.
  • Decimal doesn't have a standard prefix, so checking the `Prefix` box has no effect when `Decimal` is selected.
  • The `Group by` option simply adds a newline every few bytes for readability. When converting back, newlines are treated as separators, so you can paste the grouped output back into the input field and it will convert correctly.
BaseDigits per byteRequirement without separatorPrefix
Binary8 digitsTotal length must be a multiple of 80b
Octal3 digitsmultiple of 30o
Decimal3 digitsmultiple of 3 (000–255, zero-padded)None
Hexadecimal2 digitsmultiple of 20x

How 'Auto-detect' Works

Auto-detection works by first trying to decode the input. If it successfully decodes as a valid UTF-8 string, the input is treated as code. If it fails, it's treated as plain text. This is why, in hexadecimal mode, an English word like "cafe" is usually treated as text—the byte sequence `CA FE` is not a valid UTF-8 sequence.

However, short inputs can sometimes be misidentified by coincidence. If the result looks wrong, manually select 'Text → Code' or 'Code → Text' to lock the conversion direction.

bash
# Doing the same on the command line
echo -n "한" | xxd -b        # View as binary
echo -n "한" | xxd -p        # View as hexadecimal (ed959c)
echo -n "한" | wc -c         # UTF-8 byte count (3)
Clicking the '↕ Swap' button moves the output to the input field and re-runs the conversion using auto-detection. It's the fastest way to check if a conversion can be perfectly round-tripped.

Frequently asked questions

Can I convert special characters or emoji?

Yes. This tool uses UTF-8, the universal standard for text encoding. It correctly processes multi-byte characters like emoji (e.g., 🛠) and non-English letters, ensuring they can be converted back to text perfectly.

Does this tool support number systems other than binary?

Absolutely. In addition to binary, you can convert text to and from “Octal”, “Decimal”, and “Hexadecimal”. All formatting options, like separators and prefixes, are available for every base.

Why am I getting an error converting code back to text?

First, ensure your selected base (“Binary”, “Hexadecimal”, etc.) matches your input code. If your “Separator” is “None”, the code must be in complete chunks (e.g., 8 digits for binary, 2 for hex). The error could also mean the bytes do not form a valid UTF-8 string.

Is the text I enter kept private?

Yes, your data is completely secure. All conversions happen entirely within your browser. No information is ever sent to our servers, so you can safely convert sensitive data. The tool even works offline.