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.

Encoding, not encryption. These tools convert between ways of writing the same information. They are not secure encryption, so do not rely on them to protect anything private. Everything runs in your browser, and what you type is not sent anywhere.

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:

How many bytes UTF-8 uses
Code pointCharacterBytes in UTF-8HexBinary
U+0041A14101000001
U+00E9é2C3 A911000011 10101001
U+20AC€3E2 82 AC11100010 10000010 10101100
U+1F600😀4F0 9F 98 8011110000 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.

Characters as bytes
TextBytes (decimal)HexBinary
A654101000001
Hi72 10548 6901001000 01101001
Hello72 101 108 108 11148 65 6C 6C 6F01001000 01100101 01101100 01101100 01101111
a976101100001
z1227A01111010
0483000110000
322000100000

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.