How to Convert Text to Binary: A Step by Step Guide
By Shihab Mia July 18, 2026 6 min read
Quick answer
To convert text to binary, replace each character with its ASCII code, then write that number in 8-bit binary. The letter A has the ASCII code 65, which is 01000001 in binary. Every standard ASCII character becomes exactly one 8-bit byte, so the word Hi is 01001000 01101001.
Computers do not actually store letters. They store numbers, and those numbers are stored as binary, a system that uses only two digits: 0 and 1. When you press the letter A on your keyboard, your computer looks up a code for that letter, then keeps that code as a pattern of on and off switches. This guide shows you exactly how that translation works, so you can do it by hand or check the output of any converter with confidence.
What "text to binary" actually means
Converting text to binary is a two-stage process. First, each character is mapped to a number using a character set. For everyday English text that character set is ASCII, the American Standard Code for Information Interchange. If you want the background story, read what is ASCII. Second, that number is written in base 2 using eight binary digits, also called bits. Eight bits make one byte, and one byte is exactly enough to hold any standard ASCII character.
So "text to binary" really means "text to ASCII code to 8-bit binary". Understanding both stages is what lets you do the conversion reliably instead of memorizing patterns.
Step 1: Find each character's ASCII code
Every character has a fixed decimal code in the ASCII table. Uppercase A is 65, uppercase B is 66, and so on up the alphabet. Lowercase letters start higher: lowercase a is 97. Digits and symbols have their own codes too, and even the space character has one (it is 32). Here is a small reference chart covering common characters.
A short ASCII reference: character, decimal code, and 8-bit binary
| Character | Decimal (ASCII) | 8-bit binary |
|---|---|---|
| (space) | 32 | 00100000 |
| 0 | 48 | 00110000 |
| A | 65 | 01000001 |
| B | 66 | 01000010 |
| H | 72 | 01001000 |
| Z | 90 | 01011010 |
| a | 97 | 01100001 |
| i | 105 | 01101001 |
You do not need to memorize these. A full ASCII table reference lists all 128 codes, and most people just look them up. What matters is knowing the code is the bridge between the letter and the binary.
Step 2: Turn the code into 8-bit binary
Once you have the decimal code, you convert it to binary using place values. In an 8-bit byte, the eight positions have these values, from left to right:
The eight place values inside one byte
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
To convert a number, you work from the largest place value down to the smallest. Ask: does 128 fit into my number? If yes, write a 1 and subtract it. If no, write a 0. Move to 64 and repeat, then 32, 16, 8, 4, 2, and 1. When you finish, you have eight digits: your byte.
Take A, which is 65. Does 128 fit into 65? No, write 0. Does 64 fit? Yes, write 1 and 65 minus 64 leaves 1. Does 32, 16, 8, 4, or 2 fit into 1? No each time, so five zeros. Does 1 fit into 1? Yes, write 1. The result reads 0-1-0-0-0-0-0-1, or 01000001. That is why A is 01000001.
Worked example: converting the word "Hi"
Let us convert a whole word so you can see the full method in action. We will encode Hi, one character at a time.
- Split the word into characters: H and i. Each one becomes its own byte.
- Look up H. Its ASCII code is 72.
- Convert 72 to binary. 64 fits (leaves 8), then 8 fits (leaves 0). Positions used are 64 and 8, giving 01001000.
- Look up i (lowercase). Its ASCII code is 105.
- Convert 105 to binary. 64 fits (leaves 41), 32 fits (leaves 9), 8 fits (leaves 1), 1 fits (leaves 0). Positions used are 64, 32, 8, and 1, giving 01101001.
- Join the bytes with a space between them: 01001000 01101001.
Result
The word Hi in binary is 01001000 01101001. Two characters, two bytes, sixteen bits total. That is the pattern for any ASCII text: one character in, one 8-bit byte out.
Notice that both bytes start with a 0. That is not a coincidence. Standard ASCII only uses codes from 0 to 127, and any number in that range fits in seven bits, so the leftmost bit (worth 128) is always 0. The eighth bit is still written to keep every byte a consistent width. If you want to go the other way and read binary back into words, see how to read binary code.
Why eight bits, and where it can differ
A byte is the standard unit of storage in nearly every computer, and it holds eight bits. Eight bits can represent 256 different values (0 to 255), which comfortably covers all 128 ASCII characters with room to spare. Padding each code to a full eight digits keeps text neatly aligned, so software can slice a stream of bits into characters simply by cutting every eight positions.
- Standard ASCII uses codes 0 to 127. Every character fits in one 8-bit byte, and the top bit is always 0.
- Extended ASCII uses codes 128 to 255 for accented letters and symbols. These still fit in one byte, but now the top bit can be 1.
- Unicode and UTF-8 cover thousands of characters and emoji. Here a single character can take more than one byte, so the simple one-character-one-byte rule no longer holds.
For plain English text, though, the classic rule is reliable: one character equals one 8-bit byte.
Common mistakes to avoid
- Confusing uppercase and lowercase. They have different codes. A is 65 but a is 97, so their binary is different (01000001 versus 01100001).
- Forgetting to pad to eight digits. The code 8 is 1000 in raw binary, but as a byte it must be written 00001000. Missing zeros break the alignment.
- Ignoring spaces and punctuation. A space is a real character with code 32 (00100000). Skipping it changes the message.
- Reading place values backwards. The leftmost bit is worth 128, not 1. Always line up your digits under 128, 64, 32, 16, 8, 4, 2, 1.
- Assuming binary equals hexadecimal. They are different bases. If you need base 16 instead, read what is hexadecimal or use a text to hex tool.
Convert text to binary instantly
Doing this by hand is great for learning, but for real work you want speed and zero errors. Paste any text into the tool below and it returns the exact 8-bit binary for every character, spaces and punctuation included. You can also reverse the process later with a binary to ASCII converter.
๐ข Try the free tool ASCII to Binary Converter Free ASCII to binary converter: turn any text into 8-bit binary instantly. Type Hi to get 01001000 01101001, with per-character codes, bit count, and byte count.Now you know the whole path from a letter on your screen to the ones and zeros underneath it: look up the ASCII code, break the number into place values, mark a 1 where each value is used, and pad to eight digits. Whether you convert A into 01000001 by hand or let the tool encode a whole paragraph in an instant, the logic is the same, and you can trust every byte because you understand exactly how it was built.