An ASCII to binary converter turns each character of plain ASCII text into its binary code: one 7-bit number per character, usually written as an 8-bit byte. Type in the box above and you'll see the binary for every letter, digit and symbol, along with its decimal and hex code. Below is what ASCII is, how to convert ASCII to binary by hand, and the patterns that make ASCII codes easy to read.
What ASCII is
ASCII, the American Standard Code for Information Interchange, was first published in 1963. It gives each of 128 characters a number from 0 to 127: the uppercase and lowercase English letters, the digits 0 to 9, punctuation and symbols, the space, and 33 control codes. The 95 printable characters run from 32, the space, to 126, the tilde (~). Codes 0 to 31 and 127 are control characters, first used to steer printers and teletypes. Nearly every character encoding in use today, including UTF-8, starts with these same 128 codes.
Why ASCII is 7 bits, and why it's written as 8
128 is 2⁷, so seven bits are exactly enough for every ASCII code, from 0000000 to 1111111. Computers work in 8-bit bytes, though, so each ASCII character is stored in a byte whose first bit is 0. That's why A is usually written 01000001 rather than 1000001. Early systems used the spare eighth bit for parity checks or for extra characters, which led to many incompatible "extended ASCII" code pages. This converter writes 8 bits by default. Choose 7-bit to get the original 7-bit codes.
Converting ASCII to binary by hand
Take the word Hi. First look up each character's code: H is 72 and i is 105. Then write each code as a sum of powers of two. 72 is 64 + 8, so its bits are 1001000. 105 is 64 + 32 + 8 + 1, which gives 1101001. Add a leading 0 to each to make full bytes, and Hi becomes 01001000 01101001. If you'd rather skip the arithmetic, the decimal to binary converter shows the steps for any code, and the table on this page lists all 95 printable characters.
Patterns in ASCII binary
ASCII was laid out so that its binary codes are easy to work with:
- Letters. Uppercase letters start at 65 (
01000001) and lowercase letters at 97 (01100001). The last five bits give the letter's position in the alphabet, soZends in11010, which is 26. - Case. Upper and lowercase differ by exactly 32, a single bit. Flipping that bit switches
A(01000001) toa(01100001). - Digits. The digits 0 to 9 are codes 48 to 57, which is
0011followed by the digit's own 4-bit value, so7is00110111. - Space and punctuation. The space is 32, or
00100000, and the first block of punctuation, from!to/, follows at 33 to 47.
Control characters in binary
The control codes don't print anything, but a few of them are everywhere:
| Code | Binary | Short name | Meaning |
|---|---|---|---|
| 0 | 00000000 | NUL | Null |
| 7 | 00000111 | BEL | Bell |
| 8 | 00001000 | BS | Backspace |
| 9 | 00001001 | HT | Horizontal tab |
| 10 | 00001010 | LF | Line feed |
| 13 | 00001101 | CR | Carriage return |
| 27 | 00011011 | ESC | Escape |
| 127 | 01111111 | DEL | Delete |
Line endings are the ones you'll meet most. Linux and macOS end lines with a line feed, while Windows uses a carriage return followed by a line feed, 00001101 00001010. When you press Enter in the box above, the browser adds a line feed.
ASCII, UTF-8 and characters that don't fit
ASCII only has room for English letters. Accented letters, other alphabets, emoji, and even the curly quotes and long dashes that word processors insert are outside its 128 codes. UTF-8 solves this while staying compatible: every ASCII character keeps its single-byte code, and other characters use 2 to 4 bytes. That means Hello gives exactly the same binary in ASCII and in UTF-8. If your text contains é or 👋, this ASCII to binary converter points out the first character that doesn't fit, and the text to binary converter will encode it as UTF-8 instead.
Handy tips for ASCII text
- Pasting text from a document? Replace curly quotes (“ ”) and dashes (–) with straight quotes and hyphens first.
- Choose No separator for one continuous string of bits, or One per line for a list.
- To decode binary back into text, use the binary to ASCII converter.
- Need each character in hex instead? The hex converter turns text into hex bytes, and the ASCII table lists every code.
Remember three prefixes and you can read most ASCII binary at a glance: uppercase letters start with 010, lowercase letters with 011, and digits with 0011.