Text to Binary Converter
Convert text to binary, hex, octal or decimal bytes and back, with full UTF-8 support for emoji and every language.
Character by character
| Character | Code point | UTF-8 bytes |
|---|---|---|
| H | U+0048 | 01001000 |
| e | U+0065 | 01100101 |
| l | U+006C | 01101100 |
| l | U+006C | 01101100 |
| o | U+006F | 01101111 |
| Space | U+0020 | 00100000 |
| w | U+0077 | 01110111 |
| o | U+006F | 01101111 |
| r | U+0072 | 01110010 |
| l | U+006C | 01101100 |
| d | U+0064 | 01100100 |
| ! | U+0021 | 00100001 |
Converts text to the bytes a computer stores for it β written in binary, hex, octal or decimal β and turns those bytes back into text. It encodes as UTF-8, so accented letters, non-Latin scripts and emoji come out exactly as a file or web page would hold them, and a table shows every character with its code point and bytes.
How to use it
Choose Encode to turn text into bytes or Decode to turn bytes into text, and pick the format: binary (the default), hex, octal or decimal. When encoding, binary is padded to 8 bits, hex to two digits and octal to three, and a separator goes between bytes: a space (the default), a comma or a new line. Binary and hex can also be written with no separator, and hex bytes with a 0x prefix.
When decoding, bytes may be separated by spaces, new lines or commas, each with an optional 0b, 0x or 0o prefix. Binary and hex may also run together, as long as the length divides into whole bytes; decimal and octal bytes vary in length, so they need separators. A byte the tool cannot read is named by its position.
Below the output, the counts give characters (code points) and bytes. When encoding, the first 200 characters are listed one by one. Everything runs in your browser.
Bytes, not characters
UTF-8 stores each character in one to four bytes. The 128 ASCII characters β unaccented English letters, digits and common punctuation β take one byte each, so βAβ is 01000001. Other characters take more: βΓ©β is 2 bytes, ββ¬β 3 and an emoji 4.
Some converters skip UTF-8 and write each characterβs code directly. For βΓ©β that gives the single byte 11101001, which is not valid UTF-8: decoded here it shows as βοΏ½β. Emoji fare worse, since such tools work in UTF-16 units and split each emoji into two halves that are not characters on their own.
A character here is a Unicode code point, which is not always what looks like one character. The family emoji π¨βπ©βπ§ is three people joined by zero-width joiners: 5 code points and 18 bytes.
Examples
A greeting
βHiβ is 2 characters and 2 bytes, in binary 01001000 01101001.
An accented letter
βΓ©β is one character and 2 bytes, in binary 11000011 10101001.
An emoji
βπβ is one character and 4 bytes, in hex F0 9F 98 80.
ASCII letters and digits in binary
| Character | Binary | Character | Binary | Digit | Binary |
|---|---|---|---|---|---|
| A | 01000001 | a | 01100001 | 0 | 00110000 |
| B | 01000010 | b | 01100010 | 1 | 00110001 |
| C | 01000011 | c | 01100011 | 2 | 00110010 |
| D | 01000100 | d | 01100100 | 3 | 00110011 |
| E | 01000101 | e | 01100101 | 4 | 00110100 |
| F | 01000110 | f | 01100110 | 5 | 00110101 |
| G | 01000111 | g | 01100111 | 6 | 00110110 |
| H | 01001000 | h | 01101000 | 7 | 00110111 |
| I | 01001001 | i | 01101001 | 8 | 00111000 |
| J | 01001010 | j | 01101010 | 9 | 00111001 |
| K | 01001011 | k | 01101011 | ||
| L | 01001100 | l | 01101100 | ||
| M | 01001101 | m | 01101101 | ||
| N | 01001110 | n | 01101110 | ||
| O | 01001111 | o | 01101111 | ||
| P | 01010000 | p | 01110000 | ||
| Q | 01010001 | q | 01110001 | ||
| R | 01010010 | r | 01110010 | ||
| S | 01010011 | s | 01110011 | ||
| T | 01010100 | t | 01110100 | ||
| U | 01010101 | u | 01110101 | ||
| V | 01010110 | v | 01110110 | ||
| W | 01010111 | w | 01110111 | ||
| X | 01011000 | x | 01111000 | ||
| Y | 01011001 | y | 01111001 | ||
| Z | 01011010 | z | 01111010 |
The standard
UTF-8 is defined in RFC 3629: each Unicode code point is encoded in one to four bytes, and the first 128 code points match ASCII byte for byte. Decoding follows the same rules, and any byte sequence they do not allow is replaced with U+FFFD, the replacement character, with a note that some bytes are not valid UTF-8.
Sources
Reviewed
See also
- Number Base Converter β to convert a number, rather than text, to binary or hex.
- Base64 Encoder & Decoder β to encode text or bytes as Base64.