Ascii To Binary Converter
Enter the ascii text value to convert to binary or Binary to ASCII Text.
ASCII Text:
ASCII text includes all printable characters: letters (a-z, A-Z), digits (0-9), and symbols.
Binary:
Each ASCII character is represented as an 8-bit binary number (e.g., "A" = 01000001).
How to Convert ASCII Text to Binary — Formula:
For each character: binary = charCode.toString(2).padStart(8, "0").
Example: "Hi" → H=72=01001000, i=105=01101001 → "01001000 01101001".
Technical Details:
Standard ASCII: 128 characters in 7 bits. UTF-8 extends this to support all Unicode characters using 1-4 bytes. This converter uses 8-bit ASCII encoding.
Ascii To Binary Converter:
Convert any text to its binary representation. Each character becomes an 8-bit binary code.
ASCII Encoding: Text → Numbers → Binary
How to Convert ASCII Text to Binary
- Get character from text
- Get ASCII code (decimal) from ASCII table
- Convert decimal to 8-bit binary
- Continue with next character
Example
Convert "Hi" to binary:
"H" = 72₁₀ = 01001000₂
"i" = 105₁₀ = 01101001₂
Result: "01001000 01101001"
ASCII Text to Hex, Binary Conversion Table
| ASCII Character | Hexadecimal | Binary |
|---|---|---|
| NUL | 00 | 00000000 |
| SOH | 01 | 00000001 |
| STX | 02 | 00000010 |
| ETX | 03 | 00000011 |
| EOT | 04 | 00000100 |
| ENQ | 05 | 00000101 |
| ACK | 06 | 00000110 |
| BEL | 07 | 00000111 |
| BS | 08 | 00001000 |
| HT | 09 | 00001001 |
| LF | 0A | 00001010 |
| VT | 0B | 00001011 |
| FF | 0C | 00001100 |
| CR | 0D | 00001101 |
| SO | 0E | 00001110 |
| SI | 0F | 00001111 |
| DLE | 10 | 00010000 |
| DC1 | 11 | 00010001 |
| DC2 | 12 | 00010010 |
| DC3 | 13 | 00010011 |
| DC4 | 14 | 00010100 |
| NAK | 15 | 00010101 |
| SYN | 16 | 00010110 |
| ETB | 17 | 00010111 |
| CAN | 18 | 00011000 |
| EM | 19 | 00011001 |
| SUB | 1A | 00011010 |
| ESC | 1B | 00011011 |
| FS | 1C | 00011100 |
| GS | 1D | 00011101 |
| RS | 1E | 00011110 |
| US | 1F | 00011111 |
| Space | 20 | 00100000 |
| ! | 21 | 00100001 |
| " | 22 | 00100010 |
| # | 23 | 00100011 |
| $ | 24 | 00100100 |
| % | 25 | 00100101 |
| & | 26 | 00100110 |
| ' | 27 | 00100111 |
| ( | 28 | 00101000 |
| ) | 29 | 00101001 |
| * | 2A | 00101010 |
| + | 2B | 00101011 |
| , | 2C | 00101100 |
| - | 2D | 00101101 |
| . | 2E | 00101110 |
| / | 2F | 00101111 |
| 0 | 30 | 00110000 |
| 1 | 31 | 00110001 |
| 2 | 32 | 00110010 |
| 3 | 33 | 00110011 |
| 4 | 34 | 00110100 |
| 5 | 35 | 00110101 |
| 6 | 36 | 00110110 |
| 7 | 37 | 00110111 |
| 8 | 38 | 00111000 |
| 9 | 39 | 00111001 |
| : | 3A | 00111010 |
| ; | 3B | 00111011 |
| < | 3C | 00111100 |
| = | 3D | 00111101 |
| > | 3E | 00111110 |
| ? | 3F | 00111111 |
| @ | 40 | 01000000 |
| A | 41 | 01000001 |
| B | 42 | 01000010 |
| C | 43 | 01000011 |
| D | 44 | 01000100 |
| E | 45 | 01000101 |
| F | 46 | 01000110 |
| G | 47 | 01000111 |
| H | 48 | 01001000 |
| I | 49 | 01001001 |
| J | 4A | 01001010 |
| K | 4B | 01001011 |
| L | 4C | 01001100 |
| M | 4D | 01001101 |
| N | 4E | 01001110 |
| O | 4F | 01001111 |
| P | 50 | 01010000 |
| Q | 51 | 01010001 |
| R | 52 | 01010010 |
| S | 53 | 01010011 |
| T | 54 | 01010100 |
| U | 55 | 01010101 |
| V | 56 | 01010110 |
| W | 57 | 01010111 |
| X | 58 | 01011000 |
| Y | 59 | 01011001 |
| Z | 5A | 01011010 |
| [ | 5B | 01011011 |
| \ | 5C | 01011100 |
| ] | 5D | 01011101 |
| ^ | 5E | 01011110 |
| _ | 5F | 01011111 |
| ` | 60 | 01100000 |
| a | 61 | 01100001 |
| b | 62 | 01100010 |
| c | 63 | 01100011 |
| d | 64 | 01100100 |
| e | 65 | 01100101 |
| f | 66 | 01100110 |
| g | 67 | 01100111 |
| h | 68 | 01101000 |
| i | 69 | 01101001 |
| j | 6A | 01101010 |
| k | 6B | 01101011 |
| l | 6C | 01101100 |
| m | 6D | 01101101 |
| n | 6E | 01101110 |
| o | 6F | 01101111 |
| p | 70 | 01110000 |
| q | 71 | 01110001 |
| r | 72 | 01110010 |
| s | 73 | 01110011 |
| t | 74 | 01110100 |
| u | 75 | 01110101 |
| v | 76 | 01110110 |
| w | 77 | 01110111 |
| x | 78 | 01111000 |
| y | 79 | 01111001 |
| z | 7A | 01111010 |
| { | 7B | 01111011 |
| | | 7C | 01111100 |
| } | 7D | 01111101 |
| ~ | 7E | 01111110 |
| DEL | 7F | 01111111 |
Frequently Asked Questions
How do I convert ASCII Text to Binary?
For each character: binary = charCode.toString(2).padStart(8, "0").
What is the ASCII Text number system?
ASCII text includes all printable characters: letters (a-z, A-Z), digits (0-9), and symbols.
What is the Binary number system?
Each ASCII character is represented as an 8-bit binary number (e.g., "A" = 01000001).
Where is ASCII Text to Binary conversion used?
Standard ASCII: 128 characters in 7 bits. UTF-8 extends this to support all Unicode characters using 1-4 bytes. This converter uses 8-bit ASCII encoding.
Can I convert large ascii text numbers?
Yes. This converter handles numbers of any practical size. For very large numbers, the conversion is performed using arbitrary-precision arithmetic to ensure accuracy.
How to Convert ASCII to Binary (Characters to Binary Numbers)
Converting ASCII text to binary is how computers store every text file, email, and web page. Each character has a fixed numeric code (the ASCII value), which is stored as an 8-bit binary number. This conversion is fundamental to serial communication, file encoding, and understanding network protocols at the byte level.
- Look up each character's ASCII decimal value in the ASCII table.
- Convert each decimal value to an 8-bit binary number.
- Pad with leading zeros to ensure each character is exactly 8 bits.
- Concatenate all 8-bit groups to form the complete binary representation.
- Example: "AB" → 65, 66 → 01000001 01000010.
ASCII to Binary: Common Characters
Frequently converted characters with their ASCII codes and binary:
| Input | Output |
|---|---|
| Space | 00100000 |
| 0 (zero) | 00110000 |
| 9 | 00111001 |
| A | 01000001 |
| Z | 01011010 |
| a | 01100001 |
| z | 01111010 |
| . | 00101110 |
| @ | 01000000 |
| \n | 00001010 |
| ! | 00100001 |
| # | 00100011 |
Solved Examples: ASCII to Binary
Question 1: Convert the word "Code" to binary.
Solution:
C = 67 = 01000011
o = 111 = 01101111
d = 100 = 01100100
e = 101 = 01100101
Answer: "Code" = 01000011 01101111 01100100 01100101 (32 bits total = 4 bytes).
Question 2: Encode "Hi!" in binary for serial transmission.
Solution:
H = 72 = 01001000
i = 105 = 01101001
! = 33 = 00100001
Answer: "Hi!" = 01001000 01101001 00100001 — 24 bits sent over the wire.
Question 3: What binary does a web server send for the HTTP status "200"?
Solution:
2 = 50 = 00110010
0 = 48 = 00110000
0 = 48 = 00110000
Answer: "200" = 00110010 00110000 00110000 — text digits, not the number 200 (which would be 11001000).
Question 4: Convert the newline sequence "\r\n" (CRLF) to binary.
Solution:
\r (CR) = 13 = 00001101
\n (LF) = 10 = 00001010
Answer: CRLF = 00001101 00001010 — the Windows line ending (HTTP also uses CRLF for headers).
Practice: ASCII to Binary
Try solving these on your own to test your understanding:
- Convert "OK" to binary. (Answer: 01001111 01001011)
- What is the binary for the space character? (Answer: 00100000)
- Convert "42" (the string) to binary. (Answer: 00110100 00110010)
- What is the binary for the newline character \n? (Answer: 00001010)
- Convert "Hello" to binary. (Answer: 01001000 01100101 01101100 01101100 01101111)
- What is the binary representation of "@"? (Answer: 01000000)
How Text Files Are Actually Stored
When you save a text file, each character becomes its ASCII binary code stored sequentially on disk. A 1000-character text file uses exactly 1000 bytes (plus possible metadata). Line endings differ by OS: Unix uses LF (0x0A), Windows uses CR+LF (0x0D 0x0A), old Mac used CR (0x0D). A hex editor reveals these raw binary/hex values, showing that "text" files are just binary interpreted through the ASCII lens.
Serial Communication and Binary Transmission
UART serial communication sends ASCII characters bit by bit: start bit, 8 data bits (LSB first), optional parity bit, stop bit. At 9600 baud, each character takes about 1.04ms to transmit. When debugging serial protocols with an oscilloscope or logic analyzer, you read the binary waveform and convert to ASCII to see the message. Each high/low transition corresponds to a 1/0 in the character's binary representation.
Key Takeaways
- Look up ASCII code, convert to 8-bit binary with leading zeros.
- Digits: binary = 0011 + 4-bit digit value (0000-1001).
- Uppercase: starts at 01000001 (65); lowercase starts at 01100001 (97).
- Difference between upper and lower case is always bit 5 (value 32).
- Text files are sequential ASCII bytes — a "plain text" file IS binary.
- Line endings: Unix = 0A, Windows = 0D 0A, in binary = 00001010 or 00001101 00001010.