How to use it
- Choose a direction: Text to code to encode, Code to text to decode.
- Pick the number system: Binary, Hex, Decimal or Octal. Binary is the default.
- Type your text, or paste your code. Separate numbers with spaces, commas or line breaks. Binary and hex also work as one unbroken string.
- Read the result and press Copy result. The counter shows how many bytes your text uses.
How text becomes binary
Computers store everything as numbers. A text file is a list of bytes, and each byte is a number from 0 to 255. Binary is just a way to write that number using only 0 and 1. One byte needs 8 binary digits, called bits.
To translate text to binary, two steps happen. First, each character is looked up in a character table and turned into a number. Then that number is written in base 2, padded with zeros on the left until it is 8 digits long.
The reverse works the same way. Split the binary into groups of 8, turn each group into a number, and look the numbers up in the table again.
Worked example: "Hi" in binary
The capital letter H has the code 72. The lowercase i has the code 105. Now convert each to base 2.
- 72 = 64 + 8, so the bits for 64 and 8 are on: 01001000.
- 105 = 64 + 32 + 8 + 1, so four bits are on: 01101001.
The result is 01001000 01101001. Paste it into the tool with Code to text and Binary selected, and you get "Hi" back.
Each bit stands for a power of two. Reading from the left, the eight positions are worth 128, 64, 32, 16, 8, 4, 2 and 1. Add the values of the bits that are 1 and you have the byte.
The same word in four number systems
The tool can show the same bytes in binary, hex, decimal and octal. Here is "Hello":
| System | H | e | l | l | o |
|---|---|---|---|---|---|
| Binary | 01001000 | 01100101 | 01101100 | 01101100 | 01101111 |
| Hex | 48 | 65 | 6C | 6C | 6F |
| Decimal | 72 | 101 | 108 | 108 | 111 |
| Octal | 110 | 145 | 154 | 154 | 157 |
Hex is popular because one byte is always exactly two hex digits. Programmers use it to read memory dumps and colour codes. Octal is rarer today, but you still see it in Unix file permissions.
ASCII reference table
ASCII is the original character table. It gives 128 characters a number from 0 to 127. Here are a few you will meet often.
| Character | Binary | Hex | Decimal | Octal |
|---|---|---|---|---|
| space | 00100000 | 20 | 32 | 040 |
| ! | 00100001 | 21 | 33 | 041 |
| 0 | 00110000 | 30 | 48 | 060 |
| 9 | 00111001 | 39 | 57 | 071 |
| A | 01000001 | 41 | 65 | 101 |
| Z | 01011010 | 5A | 90 | 132 |
| a | 01100001 | 61 | 97 | 141 |
| z | 01111010 | 7A | 122 | 172 |
Two patterns are worth knowing. A capital letter and its lowercase twin differ by exactly 32, which is a single bit (the third from the left). And the digit characters 0 to 9 are codes 48 to 57, so the character "7" is not the number 7.
ASCII versus UTF-8
ASCII only covers English letters, digits and basic symbols. For everything else, modern text uses UTF-8. It is a variable-length encoding that uses one to four bytes per character. The first 128 codes are identical to ASCII, so plain English text produces the same bytes in both.
This tool encodes your text as UTF-8 before it writes any numbers. That is why the byte counter can be larger than the number of characters you typed.
| Character | Bytes | Binary | Hex |
|---|---|---|---|
| A | 1 | 01000001 | 41 |
| é | 2 | 11000011 10101001 | C3 A9 |
| € | 3 | 11100010 10000010 10101100 | E2 82 AC |
| 😀 | 4 | 11110000 10011111 10011000 10000000 | F0 9F 98 80 |
Look at the leading bits. A byte starting with 0 is a single ASCII character. A byte starting with 110, 1110 or 11110 begins a character of two, three or four bytes. Continuation bytes always start with 10. That is how a decoder knows where each character begins.
Common mistakes
- Dropping a bit. Binary must come in groups of 8. If you paste 7-bit groups (some old ASCII tables show them), "H" would read as 1001000. Pad each one with a leading 0.
- Choosing the wrong number system. The text 48 65 6C is hex. Decoded as decimal it gives an error, because 6C is not a decimal number.
- Values above 255. A byte cannot be larger than 255 (11111111). Unicode code points such as 8364 for the euro sign are not bytes. Use the UTF-8 bytes shown above instead.
- Cutting a multi-byte character. If you copy only the first byte of é, the decoder cannot finish the character and shows a replacement mark.
- Reading binary as encryption. Binary hides nothing. It is the normal, open form of the data.
Variants you may run into
Hex strings. Often written as "48656C6C6F" with no spaces, or with a 0x prefix on each byte. The tool accepts both, and also the 0b and 0o prefixes for binary and octal.
Other bases for bytes. Base64 packs bytes into 64 printable characters. It is shorter than hex and is the usual choice for email attachments and embedded images.
Other codes for text. Morse code also writes letters with two symbols, but with variable length, so it needs pauses to separate letters. Binary text uses a fixed width instead.
UTF-16 and UTF-32. These use two or four bytes per character. They exist, but the web uses UTF-8, and so does this translator.
A short history
The idea of writing information with two symbols is old. Leibniz described binary arithmetic in 1703. For text, early telegraph codes such as Baudot used 5 bits per letter. ASCII was first published in 1963 and fixed 7 bits per character, with an 8th bit often used for error checking. Later 8-bit extensions added accents, but each region had its own version, and files often turned into gibberish when moved between systems.
UTF-8 was designed in 1992 and described in RFC 3629 in 2003. It solved that problem with one scheme for every language, while staying compatible with ASCII.
Sources
Checked October 2026.
Frequently asked questions
How do I translate binary to text?
Pick Code to text, choose Binary, and paste the 0s and 1s. The tool reads them in groups of 8 bits, turns each group into a byte, and decodes the bytes as UTF-8. For example, 01001000 01101001 becomes "Hi".
How do I convert text to binary?
Each character is turned into one or more bytes, and each byte is written as 8 binary digits. The letter H is byte 72, which is 01001000. "Hello" becomes 01001000 01100101 01101100 01101100 01101111.
Why does one character give more than 8 bits?
Plain English letters, digits and punctuation take one byte each. Characters such as é take two bytes, the euro sign takes three, and most emoji take four. The tool encodes text as UTF-8, so é shows as 11000011 10101001.
Do I need spaces between the bytes?
No. Spaces, commas, semicolons and line breaks all work as separators. Binary and hex can also be pasted as one long string, and the tool splits it into 8-bit or 2-digit groups. Decimal and octal need separators.
Why do I get an error when decoding?
Either a number contains a digit that does not belong to the chosen system (a 2 in binary, for instance), or a number is larger than 255, which does not fit in one byte. Check that the number system buttons match your input.
What is the difference between ASCII and UTF-8?
ASCII defines 128 characters and fits in 7 bits. UTF-8 keeps those same codes for the same characters and adds multi-byte sequences for everything else. Pure English text gives identical bytes in both. See also Base64 for another way to write bytes as text.