How to convert text to binary
Every character has a number. For letters, digits and punctuation it is the ASCII code (A is 65, a is 97, a space is 32). Write that number in binary with 8 digits, using the place values 128, 64, 32, 16, 8, 4, 2 and 1, and put a space between the bytes. Here is the first character of yours:
Here it is with your numbers:
- “H” is code 72 in the ASCII table.
- 72 = 64 + 8, so those places get a 1 and the rest a 0: 01001000.
It means “Hi” is 01001000 01101001 in binary.
To go back from binary to text, add up the place values that have a 1 and look the number up: 01001000 is 64 + 8, which is 72, the capital H.
Source RFC 20 (Internet Standard 80) · ASCII format for network interchange ↗
Your characters in binary
| Character | Binary | Decimal | Hex |
|---|---|---|---|
| H U+0048 | 01001000 | 72 | 48 |
| i U+0069 | 01101001 | 105 | 69 |
For a character outside ASCII, the decimal and hex columns show each of its UTF-8 bytes, and the small U+ code next to each character is its own Unicode number.
ASCII letters in binary
Tap a letter to convert it.
| Capital | Binary | Small | Binary |
|---|---|---|---|
| A | 01000001 | a | 01100001 |
| B | 01000010 | b | 01100010 |
| C | 01000011 | c | 01100011 |
| D | 01000100 | d | 01100100 |
| E | 01000101 | e | 01100101 |
| F | 01000110 | f | 01100110 |
| G | 01000111 | g | 01100111 |
| H | 01001000 | h | 01101000 |
| I | 01001001 | i | 01101001 |
| J | 01001010 | j | 01101010 |
| 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 digits 0 to 9 are codes 48 to 57 (00110000 to 00111001), and a space is 32 (00100000).
What about accents and emoji? (UTF-8)
ASCII only has 128 codes, so it has no é, ñ, € or 😀. Today’s computers use Unicode, which gives every character a number, and store it with UTF-8: the 128 ASCII characters stay one byte, exactly as before, and every other character takes 2, 3 or 4 bytes, depending on its number.
| Unicode numbers | Bytes | Pattern |
|---|---|---|
| U+0000 – U+007F | 1 | 0xxxxxxx |
| U+0080 – U+07FF | 2 | 110xxxxx 10xxxxxx |
| U+0800 – U+FFFF | 3 | 1110xxxx 10xxxxxx 10xxxxxx |
| U+10000 – U+10FFFF | 4 | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx |
The x’s hold the character’s number in binary. So é (Unicode 233) is 11000011 10101001, € is 3 bytes and 😀 is 4. A single byte like 11101001 on its own isn’t valid UTF-8, so when binary doesn’t decode, the converter tells you which byte is wrong and why instead of showing a garbled character.
Source RFC 3629 · UTF-8, a transformation format of ISO 10646 ↗
FAQs
How can I convert text to 1 and 0?
Look up each character’s code and write it in 8 binary digits. A is 65 in the ASCII table, and 65 = 64 + 1, so A is 01000001. Do the same for each character and put a space between the bytes, or type the text in the converter above.
Source RFC 20 (Internet Standard 80) · ASCII format for network interchange ↗
How can I convert English to binary code?
English letters, digits and punctuation are all in the ASCII table, so each one becomes one byte (8 bits). Capital letters are 65 to 90 (01000001 to 01011010) and small letters 97 to 122 (01100001 to 01111010). A space is 32, or 00100000.
How to write "I love you" in binary code?
01001001 00100000 01101100 01101111 01110110 01100101 00100000 01111001 01101111 01110101: ten bytes, one for each letter and one for each space (00100000). As ASCII codes it is 73 32 108 111 118 101 32 121 111 117.
What is your name in binary?
Type your name in the box above to see it. Each letter is one byte: a capital letter starts 010 and a small letter starts 011. “Sam”, for example, is 01010011 01100001 01101101.
What does the following binary code translate to 01101000, 01100101, 01101100, 01101100, 01101111?
It spells hello, in small letters: 104 is h, 101 is e, 108 is l (twice) and 111 is o.
What is 01100011 in binary?
01100011 is the small letter c: 64 + 32 + 2 + 1 makes code 99.
What does 01101100 mean?
01101100 is the small letter l: 64 + 32 + 8 + 4 makes code 108.
What is 01000010 in ASCII?
01000010 is the capital letter B: 64 + 2 makes code 66.
What is the ASCII code from a to z?
Small letters a to z are 97 to 122, and capitals A to Z are 65 to 90. A small letter’s code is always its capital’s code plus 32, so in binary only one digit changes (A 01000001, a 01100001).
Sources
- RFC 20 (Internet Standard 80): ASCII format for network interchange
- RFC 3629: UTF-8, a transformation format of ISO 10646