Binary to ASCII Converter
Convert binary code to ASCII text and ASCII to binary instantly. Supports 8-bit binary strings with auto-delimiter detection.
About
Binary-to-ASCII conversion maps each 8-bit binary octet to its corresponding character in the ASCII table (values 0 - 127 for standard ASCII, 0 - 255 for extended). A single misaligned bit shifts every subsequent character, producing garbage output. This tool auto-detects delimiters (spaces, commas, or continuous streams) and validates that each chunk is exactly 8 bits before calling parseInt(chunk, 2). It flags non-binary digits and incomplete octets rather than silently corrupting output.
The reverse path (ASCII → binary) converts each character code via toString(2) and zero-pads to 8 bits. Note: this tool operates on single-byte encodings. Multi-byte UTF-8 characters (emoji, CJK) will be split into their constituent bytes, which may not round-trip cleanly if you expect one character per octet. For pure ASCII text (Latin letters, digits, punctuation), conversion is lossless and bidirectional.
Formulas
Binary → ASCII conversion proceeds character by character. Each 8-bit binary string is interpreted as a base-2 positional integer:
Where bi is the i-th bit (leftmost = i = 0). The resulting charCode maps directly to the ASCII table. For example, the binary string 01001000 yields 0 ⋅ 128 + 1 ⋅ 64 + 0 ⋅ 32 + 0 ⋅ 16 + 1 ⋅ 8 + 0 ⋅ 4 + 0 ⋅ 2 + 0 ⋅ 1 = 72, which is the character "H".
The reverse path applies:
Where pad8 left-pads the result with zeros to ensure exactly 8 bits. charCode is obtained from the character via its code point. Valid ASCII range: 0 ≤ charCode ≤ 127 (standard) or 0 ≤ charCode ≤ 255 (extended).
Reference Data
| Character | Decimal | Hex | Binary | Description |
|---|---|---|---|---|
| NUL | 0 | 00 | 00000000 | Null |
| TAB | 9 | 09 | 00001001 | Horizontal Tab |
| LF | 10 | 0A | 00001010 | Line Feed |
| CR | 13 | 0D | 00001101 | Carriage Return |
| SP | 32 | 20 | 00100000 | Space |
| ! | 33 | 21 | 00100001 | Exclamation Mark |
| 0 | 48 | 30 | 00110000 | Digit Zero |
| 9 | 57 | 39 | 00111001 | Digit Nine |
| A | 65 | 41 | 01000001 | Uppercase A |
| Z | 90 | 5A | 01011010 | Uppercase Z |
| a | 97 | 61 | 01100001 | Lowercase a |
| z | 122 | 7A | 01111010 | Lowercase z |
| @ | 64 | 40 | 01000000 | At Sign |
| # | 35 | 23 | 00100011 | Number Sign |
| & | 38 | 26 | 00100110 | Ampersand |
| ( | 40 | 28 | 00101000 | Left Parenthesis |
| ) | 41 | 29 | 00101001 | Right Parenthesis |
| + | 43 | 2B | 00101011 | Plus Sign |
| - | 45 | 2D | 00101101 | Hyphen-Minus |
| . | 46 | 2E | 00101110 | Full Stop |
| / | 47 | 2F | 00101111 | Solidus |
| = | 61 | 3D | 00111101 | Equals Sign |
| { | 123 | 7B | 01111011 | Left Curly Bracket |
| } | 125 | 7D | 01111101 | Right Curly Bracket |
| ~ | 126 | 7E | 01111110 | Tilde |
| DEL | 127 | 7F | 01111111 | Delete |