Home / Text to binary and hex explained
Text to binary and hex explained
Updated December 3, 2026
What happens between typing a letter and seeing 01001000 or 48. Four short steps, with a table you can check by hand.
Step 1: a character has a number
Every character has a number. For English letters, digits and punctuation that number is the ASCII code, for example H is 72 (see the ASCII table). Other characters have larger numbers in Unicode, such as U+20AC for the euro sign.
Step 2: the number is stored in bytes with UTF-8
UTF-8 is the encoding the binary and hex tools use. In UTF-8, characters from U+0000 to U+10FFFF are encoded using sequences of 1 to 4 octets (bytes). The only byte of a sequence of one has the higher-order bit set to 0, and the remaining 7 bits encode the character number, which is why ASCII text is also valid UTF-8. The table shows what that means for a few characters:
| Code point | Character | Bytes in UTF-8 | Hex | Binary |
|---|---|---|---|---|
| U+0041 | A | 1 | 41 | 01000001 |
| U+00E9 | é | 2 | C3 A9 | 11000011 10101001 |
| U+20AC | € | 3 | E2 82 AC | 11100010 10000010 10101100 |
| U+1F600 | 😀 | 4 | F0 9F 98 80 | 11110000 10011111 10011000 10000000 |
Step 3: each byte is written in binary or hex
A byte is 8 binary digits (bits). Binary is base 2, where each digit is called a bit. Hexadecimal is base 16, where one hex digit represents four bits, and so an 8-bit byte is two hex digits. Split a byte into two halves of four bits and each half becomes one hex digit: 0100 1000 is 4 and 8, so 48.
| Text | Bytes (decimal) | Hex | Binary |
|---|---|---|---|
| A | 65 | 41 | 01000001 |
| Hi | 72 105 | 48 69 | 01001000 01101001 |
| Hello | 72 101 108 108 111 | 48 65 6C 6C 6F | 01001000 01100101 01101100 01101100 01101111 |
| a | 97 | 61 | 01100001 |
| z | 122 | 7A | 01111010 |
| 0 | 48 | 30 | 00110000 |
| 32 | 20 | 00100000 |
Step 4: reading it back
Reverse the steps: group the bits into bytes, read the bytes as UTF-8, and look up the characters. Bytes that do not form valid UTF-8 cannot be turned into text. RFC 3629 warns that decoders must protect against invalid sequences, for instance “a naive implementation may decode the overlong UTF-8 sequence C0 80 into the character U+0000”, which is why the tools here report an error instead of guessing.
Try it with the binary translator or the hex converter.