About the Text to Binary
Computers store every letter as a number, and every number as a pattern of ones and zeros. Type any text and the Text to Binary converter shows those patterns: the letter H, for example, is 01001000.
Besides binary, you can see the same bytes in hexadecimal, octal or decimal. The text is encoded as UTF-8 by default, the encoding used on the web, so accented letters, other alphabets and emoji work too. They simply take two, three or four bytes instead of one. For programming tasks, you can switch to UTF-16 code units, the way JavaScript, Java and Windows store strings.
Choose how the output is spaced: between bytes, between characters, not at all, or one byte per line. It is useful for learning how text encoding works, for puzzles and secret messages, and for checking what bytes a string really contains. Everything runs in your browser.
How to use it
- Type your textEnter any text in any language. Sample loads "Hi 👋", a short example with an emoji.
- Choose a number systemBinary, Hex, Octal or Decimal. The output updates immediately.
- Pick the spacingSpace between bytes, space between characters, no spaces, or one byte per line.
- Choose the encodingUTF-8 shows the bytes as they are stored in files and sent over the web. UTF-16 shows 16-bit code units, as used inside many programming languages.
- Copy the resultThe status line shows how many characters and bytes you converted. Copy the code or download it as a text file.
Key features
Four number systems
Binary with 8 digits per byte, hex with 2, octal with 3, and decimal.
Real UTF-8
Every character, including é, € and emoji, is converted to the exact bytes UTF-8 uses.
UTF-16 option
See the 16-bit code units of a string, including the two surrogate halves of an emoji.
Flexible spacing
Group the output by byte or by character, write it as one long string, or put each byte on its own line.
Leading zeros kept
Every byte is padded to full length, so 01000001 never becomes 1000001 and the code can be read back reliably.
Private by design
Nothing is uploaded. The conversion happens in your browser.
Examples
"Hi 👋" in every number system
The sample is 4 characters (H, i, a space and the emoji) and 7 bytes in UTF-8:
| System | Result |
|---|---|
| Binary | 01001000 01101001 00100000 11110000 10011111 10010001 10001011 |
| Hex | 48 69 20 F0 9F 91 8B |
| Decimal | 72 105 32 240 159 145 139 |
H, i and the space are one byte each. The emoji 👋 takes four bytes, F0 9F 91 8B in hex.
Letters and their bytes
| Character | Binary (UTF-8) | Hex |
|---|---|---|
| A | 01000001 | 41 |
| é | 11000011 10101001 | C3 A9 |
| € | 11100010 10000010 10101100 | E2 82 AC |
| Line break | 00001010 | 0A |
The first bits of a byte tell UTF-8 how long a character is: bytes starting with 0 stand alone, 110 starts a two-byte character, 1110 a three-byte one and 11110 a four-byte one.
Spacing options
For the word "Hi" in binary:
- Space between bytes:
01001000 01101001 - No spaces:
0100100001101001 - One byte per line:
01001000and01101001on separate lines
Space between characters matters for multi-byte characters: the emoji in the sample becomes one block, 11110000100111111001000110001011, instead of four.
UTF-8 versus UTF-16
With UTF-16, "Hi 👋" becomes 5 code units of 16 bits each. The emoji is stored as two of them, D83D and DC4B in hex, called a surrogate pair:
0000000001001000 0000000001101001 0000000000100000 1101100000111101 1101110001001011 Tips
- Use hex when you compare bytes with a hex editor, a network capture or a programming tool. It is much shorter than binary and shows the same information.
- To decode the result, paste it into Binary to Text with the same number system. Choose UTF-8 there for UTF-8 output, or Unicode code points for UTF-16 output with spaces between the units.
- For puzzles and secret messages, choose Binary with No spaces. The message is harder to read at a glance, and Binary to Text can still split it into bytes.
- If a character looks the same as another but behaves differently, convert both. An accented letter typed as one character and one made of a letter plus an accent mark give different bytes.
- To get the Base64 form of the same bytes for an email or an API, use the Base64 Encoder.
Common mistakes and limits
- Expecting one byte per characterOnly basic English letters, digits and punctuation take one byte in UTF-8. Accented letters take two, most other scripts and symbols three, and emoji four.
- Confusing UTF-8 and UTF-16The two encodings give different numbers for the same text. UTF-16 output decoded as UTF-8 gives the wrong characters, so decode it as Unicode code points instead.
- Dropping leading zerosWriting 01000001 as 1000001 breaks decoding when bytes are not separated. Keep all eight digits.
- Decimal without spacesWith No spaces, decimal bytes are padded to three digits, as in 072105 for "Hi". Binary to Text cannot split decimal numbers that run together, so keep the spaces if you want to decode decimal output.
- Converting only spacesText made only of spaces or line breaks shows no result. Add at least one other character to see the bytes.