How to Convert Text to Binary (and Binary Back to Text)
How letters become 8-bit binary codes using ASCII, with worked examples like "Hi" = 01001000 01101001, a mini table, decoding steps and common mistakes.
The short answer
To convert text to binary, replace each character with its character code (A = 65, a = 97, space = 32) and write that number in base 2 as 8 digits. "Hi" becomes 01001000 01101001. To go back, split the binary into 8-digit groups, convert each group to a number and look up the character. The Binary Translator does both directions instantly and also shows the hexadecimal and decimal codes.
How text becomes binary
Computers store text as numbers. A character encoding is the agreed list that says which number means which character. For English letters, digits and common punctuation, the codes come from ASCII, which assigns numbers 0 to 127. Those codes are the same in Unicode and in UTF-8, which is what nearly all modern text uses.
Binary is just another way to write those numbers, using only 0 and 1. Each position is worth double the one to its right:
| Position value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| H = 72 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 |
| i = 105 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
72 = 64 + 8, so the 64 and 8 positions are 1. 105 = 64 + 32 + 8 + 1. Writing all eight positions, with leading zeros, gives one byte per character.
Converting by hand, step by step
Example: "Cat"
- C = 67 = 64 + 2 + 1 →
01000011 - a = 97 = 64 + 32 + 1 →
01100001 - t = 116 = 64 + 32 + 16 + 4 →
01110100
Result: 01000011 01100001 01110100. We checked every example in this article by running the tool's own conversion code.
Mini reference table
| Character | Decimal | Hex | Binary |
|---|---|---|---|
| space | 32 | 20 | 00100000 |
| ! | 33 | 21 | 00100001 |
| 0 | 48 | 30 | 00110000 |
| A | 65 | 41 | 01000001 |
| H | 72 | 48 | 01001000 |
| a | 97 | 61 | 01100001 |
| e | 101 | 65 | 01100101 |
| l | 108 | 6C | 01101100 |
| o | 111 | 6F | 01101111 |
Two useful patterns:
- Upper and lower case differ by one bit. A is
01000001and a is01100001. The third digit from the left (worth 32) is the only difference, and the same holds for every letter. - Digits are not their own value. The character "0" is code 48,
00110000, not00000000. Converting the number 5 as a value is a different job; for that, use a number base converter.
Using the Binary Translator
Text to binary
"Hello" gives 01001000 01100101 01101100 01101100 01101111, hex 48 65 6C 6C 6F and decimal 72 101 108 108 111.
Binary to text
?.Everything runs in your browser; nothing you type is sent anywhere.
Common mistakes when decoding
No spaces between bytes. 0100100001101001 is meant to be "Hi", but without a space the tool reads it as one large number and shows a single unrelated character. Insert a space after every 8 digits.
Digits other than 0 and 1. A group like 01001002 contains a 2. The tool reads only the digits before the 2 and shows a wrong character, not an error. Check copied text for stray characters, letter O instead of zero, or the letter l instead of the digit 1.
Missing leading zeros. 1001000 (7 digits) still decodes to H, because leading zeros do not change the value, but 8-digit groups are easier to check and are what most puzzles and lessons expect.
Accented letters, symbols and emoji
The tool converts each character using the code JavaScript reports for it:
- Latin accents like é (code 233) still fit in 8 bits:
11101001. Note that in UTF-8 files, é is actually stored as two bytes,11000011 10101001, so you may see a different answer in other tools. - Characters above 255, such as ₹ (code 8377), produce longer groups:
10000010111001(14 digits). The tool does not split them into UTF-8 bytes. - Emoji are stored by JavaScript as two codes, so 😀 appears as two 16-digit groups.
These longer groups decode back correctly in this tool, but other decoders that expect 8-bit UTF-8 bytes will not understand them. For plain English text, every tool agrees.
Where text-to-binary is useful
- Computer science homework on encoding and number systems.
- Puzzles, escape rooms and treasure hunts, where a message is hidden as 0s and 1s.
- Understanding file sizes: each ASCII character is one byte, so 1,000 plain English characters take about 1,000 bytes.
It is not encryption. Anyone can decode binary text in seconds, so never use it to hide passwords or private messages. For actual protection, see the Text Encryption tool.
For converting numbers (rather than text) between binary, decimal and hexadecimal, read Binary, Decimal, Hexadecimal: Converting Between Number Systems.
Frequently asked questions
How do you write "Hi" in binary?
H is character code 72 and i is 105, so "Hi" in 8-bit binary is 01001000 01101001.
Why does my binary decode to a strange character?
The groups are probably not separated. Put a space after every 8 digits so each character is read separately, and check there are no digits other than 0 and 1.
What is the difference between A and a in binary?
A is 01000001 (65) and a is 01100001 (97). They differ only in the bit worth 32, and that is true for every letter of the English alphabet.
Is converting text to binary a form of encryption?
No. Binary is a standard way to write character codes and anyone can decode it instantly. Use real encryption to protect private text.
Put this guide into practice with our free online tool — no signup required.
Open tool