Binary Translator — Text to Binary & Binary to Text
What is Binary?
Binary is a base-2 number system that uses only two digits: 0 and 1. Every piece of data a computer processes — text, images, audio, programs — is ultimately stored as a sequence of these two values. A PNG is just such a byte sequence; the image to Base64 converter regroups its bits six at a time so the picture can be embedded in HTML or CSS as plain text. A single binary digit is called a bit; eight bits form a byte, which can represent 256 different values (28 = 256). The letter "A" in ASCII is the byte 01000001, which is the number 65 in decimal.
Binary exists because digital circuits are built from transistors that have two states: on and off. The entire stack — from logic gates to processors to programming languages — rests on this foundation. Understanding binary is not just academic; it appears in debugging, networking, file formats, and permissions.
How Text-to-Binary Translation Works
Converting text to binary is a two-step process. First, each character is mapped to a number using a character encoding — ASCII for English letters and symbols, UTF-8 for everything else including emoji and accented characters. Second, each number is converted to its binary representation, padded to 8 bits per byte.
For ASCII characters (codes 0-127), each character is exactly one byte. The letter "H" is 72 in decimal, which is 01001000 in binary. The word "Hi" becomes 01001000 01101001 — two bytes, 16 bits.
For characters outside ASCII — accented letters, CJK characters, emoji — UTF-8 uses multiple bytes per character. The emoji 🚀 is four bytes in UTF-8: 11110000 10011111 10011010 10000000. This tool handles UTF-8 automatically, so emoji and international text convert correctly. This is the same UTF-8 encoding step that matters in Base64 encoding and hashing — get the encoding wrong and the output is wrong.
ASCII to Binary Table — All Printable Characters
Every printable ASCII character from 32 (space) to 126 (tilde), plus 127 (DEL), with the 8-bit pattern this translator produces for it. Codes 0–31 are control characters such as tab (00001001) and newline (00001010).
| Dec | Binary | Char | Dec | Binary | Char | Dec | Binary | Char |
|---|---|---|---|---|---|---|---|---|
| 32 | 00100000 | (space) | 64 | 01000000 | @ | 96 | 01100000 | ` |
| 33 | 00100001 | ! | 65 | 01000001 | A | 97 | 01100001 | a |
| 34 | 00100010 | " | 66 | 01000010 | B | 98 | 01100010 | b |
| 35 | 00100011 | # | 67 | 01000011 | C | 99 | 01100011 | c |
| 36 | 00100100 | $ | 68 | 01000100 | D | 100 | 01100100 | d |
| 37 | 00100101 | % | 69 | 01000101 | E | 101 | 01100101 | e |
| 38 | 00100110 | & | 70 | 01000110 | F | 102 | 01100110 | f |
| 39 | 00100111 | ' | 71 | 01000111 | G | 103 | 01100111 | g |
| 40 | 00101000 | ( | 72 | 01001000 | H | 104 | 01101000 | h |
| 41 | 00101001 | ) | 73 | 01001001 | I | 105 | 01101001 | i |
| 42 | 00101010 | * | 74 | 01001010 | J | 106 | 01101010 | j |
| 43 | 00101011 | + | 75 | 01001011 | K | 107 | 01101011 | k |
| 44 | 00101100 | , | 76 | 01001100 | L | 108 | 01101100 | l |
| 45 | 00101101 | - | 77 | 01001101 | M | 109 | 01101101 | m |
| 46 | 00101110 | . | 78 | 01001110 | N | 110 | 01101110 | n |
| 47 | 00101111 | / | 79 | 01001111 | O | 111 | 01101111 | o |
| 48 | 00110000 | 0 | 80 | 01010000 | P | 112 | 01110000 | p |
| 49 | 00110001 | 1 | 81 | 01010001 | Q | 113 | 01110001 | q |
| 50 | 00110010 | 2 | 82 | 01010010 | R | 114 | 01110010 | r |
| 51 | 00110011 | 3 | 83 | 01010011 | S | 115 | 01110011 | s |
| 52 | 00110100 | 4 | 84 | 01010100 | T | 116 | 01110100 | t |
| 53 | 00110101 | 5 | 85 | 01010101 | U | 117 | 01110101 | u |
| 54 | 00110110 | 6 | 86 | 01010110 | V | 118 | 01110110 | v |
| 55 | 00110111 | 7 | 87 | 01010111 | W | 119 | 01110111 | w |
| 56 | 00111000 | 8 | 88 | 01011000 | X | 120 | 01111000 | x |
| 57 | 00111001 | 9 | 89 | 01011001 | Y | 121 | 01111001 | y |
| 58 | 00111010 | : | 90 | 01011010 | Z | 122 | 01111010 | z |
| 59 | 00111011 | ; | 91 | 01011011 | [ | 123 | 01111011 | { |
| 60 | 00111100 | < | 92 | 01011100 | \ | 124 | 01111100 | | |
| 61 | 00111101 | = | 93 | 01011101 | ] | 125 | 01111101 | } |
| 62 | 00111110 | > | 94 | 01011110 | ^ | 126 | 01111110 | ~ |
| 63 | 00111111 | ? | 95 | 01011111 | _ | 127 | 01111111 | (DEL) |
Binary Alphabet — Letters A to Z in Binary
The binary alphabet is simply the ASCII codes for the 26 letters written in base 2. Uppercase A is 65 (01000001) and each following letter adds one, up to Z at 90 (01011010). Lowercase a starts at 97 (01100001) and runs to z at 122 (01111010).
| Upper | Binary | Lower | 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 |
Compare any row and you will see a pattern: an uppercase letter and its lowercase partner differ in exactly one bit, the third from the left, which is worth 32. Uppercase letters begin 010, lowercase letters begin 011, and the last five bits give the letter's position in the alphabet (00001 for A, 11010 for Z, which is 26). That is why case conversion in C is often written as c ^ 0x20: flipping bit 5 toggles the case of any ASCII letter.
To write a word in binary, look up each letter and join the bytes. Ada becomes 01000001 01100100 01100001, and SOS becomes 01010011 01001111 01010011. Case matters: Hello starts with 01001000 while hello starts with 01101000.
How to Read Binary by Hand
Each position in a byte has a place value, doubling from right to left. To turn a byte into a number, add up the place values wherever there is a 1:
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | Sum |
|---|---|---|---|---|---|---|---|---|---|
01001000 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 64 + 8 = 72 → H |
01101001 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 64 + 32 + 8 + 1 = 105 → i |
So 01001000 01101001 is 72 and 105, which the ASCII table above turns into Hi. Going the other way, divide by 2 repeatedly and write down the remainders. For 105: 105 → 52 remainder 1, 52 → 26 r 0, 26 → 13 r 0, 13 → 6 r 1, 6 → 3 r 0, 3 → 1 r 1, 1 → 0 r 1. Reading the remainders from the last one back to the first gives 1101001. Pad that to eight bits with a leading zero and you get 01101001, which is exactly what the translator prints for i.
Binary in Programming
Binary is not just a theoretical concept — it shows up directly in everyday programming:
- Unix file permissions.
chmod 755is three octal digits, each representing three permission bits: read (4), write (2), execute (1). The binary is111 101 101— owner can do everything, group and others can read and execute. - Network subnet masks.
255.255.255.0is11111111.11111111.11111111.00000000in binary. The boundary between ones and zeros is the boundary between the network and host portions of an IP address. - Bitwise flags. Feature toggles, permission sets, and status registers pack multiple boolean values into a single integer. Checking
flags & 0x04tests whether bit 2 is set. - Color values. The hex color
#FF5733is three bytes in binary:11111111 01010111 00110011— red 255, green 87, blue 51.
How to Convert in Code
JavaScript
// Text to binary
const binary = [...new TextEncoder().encode("Hello")]
.map(b => b.toString(2).padStart(8, "0")).join(" ");
// Binary to text
const text = new TextDecoder().decode(
new Uint8Array("01001000 01101001".split(" ")
.map(b => parseInt(b, 2)))
);
Python
# Text to binary
binary = ' '.join(format(b, '08b') for b in "Hello".encode('utf-8'))
# Binary to text
text = bytes(int(b, 2) for b in "01001000 01101001".split()).decode('utf-8')
Bash
# Text to binary (one byte per line)
echo -n "Hello" | xxd -b | cut -d' ' -f2-7
# Binary to text
echo "01001000 01101001" | perl -lape '$_=pack"B*",join"",@F'
Encoding Matters: ASCII vs UTF-8
ASCII maps 128 characters to the numbers 0-127, each fitting in a single byte. It covers English letters, digits, punctuation, and control characters. For decades this was sufficient, but it cannot represent accented characters, Chinese, Arabic, or emoji.
UTF-8 is a variable-length encoding that is backward-compatible with ASCII: characters 0-127 are identical. Characters above 127 use 2-4 bytes, with leading bits that indicate the byte count. This is why "é" is two bytes in UTF-8 (11000011 10101001) but one byte in Latin-1 (11101001). This tool uses UTF-8, which is the encoding of the modern web — over 98% of websites use it.
Common Binary Prefixes
| Prefix | Symbol | Bytes | Decimal approx. |
|---|---|---|---|
| Kilobyte | KB | 1,024 | ~1 thousand |
| Megabyte | MB | 1,048,576 | ~1 million |
| Gigabyte | GB | 1,073,741,824 | ~1 billion |
| Terabyte | TB | 1,099,511,627,776 | ~1 trillion |
The discrepancy between binary (1 KB = 1,024 bytes) and decimal (1 kB = 1,000 bytes) definitions is why a "500 GB" hard drive shows as 465 GB in your operating system. Storage manufacturers use decimal; operating systems use binary. The IEC introduced unambiguous prefixes — kibibyte (KiB), mebibyte (MiB) — but adoption remains inconsistent.
Binary and Other Number Bases
Binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) are different ways to represent the same numbers. Programmers use hex because each hex digit maps to exactly four bits, making it a compact way to write binary. (To convert a number rather than text between these bases — including 64-bit values and negative numbers in two's complement — use the hex converter.)
| Binary | Decimal | Octal | Hex |
|---|---|---|---|
| 0000 | 0 | 0 | 0 |
| 0001 | 1 | 1 | 1 |
| 0101 | 5 | 5 | 5 |
| 1010 | 10 | 12 | A |
| 1111 | 15 | 17 | F |
| 11111111 | 255 | 377 | FF |
This is why hash outputs are displayed in hex rather than binary — a SHA-256 digest is 256 bits, which is 64 hex characters instead of 256 binary digits.
Two's Complement — How Computers Store Negative Numbers
Computers represent negative integers using two's complement. To negate a number: flip every bit and add 1. In an 8-bit system, 00000101 is +5 and 11111011 is −5. The leading bit acts as a sign indicator: 0 for positive, 1 for negative. This system has a useful property — addition works the same for positive and negative numbers, so the processor does not need separate circuits for subtraction.
Common Mistakes When Translating Binary
- Typing a number and expecting its binary value. A text-to-binary translator encodes characters, not numbers. Typing
65gives00110110 00110101, which is the digit characters "6" and "5", not01000001. The same applies to epoch timestamps:2147483647comes out as ten bytes (80 bits) of digit characters, while the integer itself fits in 32 bits. - Dropping leading zeros. Some calculators print 72 as
1001000(seven digits). Paste1001000 1101001into Binary → Text and the tool reports "Binary length must be a multiple of 8 bits. Got 14 bits — missing 2." Pad every group back to eight digits (01001000 01101001) and it decodes to "Hi". - Look-alike characters. Everything except
0and1is discarded when decoding, which is what lets commas, spaces, and newlines work as separators. It also means a lowercaseltyped in place of a1silently disappears:01001000 0110100lis read as 15 bits and rejected as "missing 1". - Decoding bytes from another encoding. This tool decodes UTF-8. The single byte
11101001is "é" in Latin-1, but in UTF-8 it is an incomplete multi-byte sequence, so the tool shows an invalid-data error instead of guessing. The UTF-8 form of "é" is two bytes,11000011 10101001. - Counting characters as bytes. Only ASCII is one byte per character. The Bytes and Bits counters under the tool show the real size:
éis 2 bytes and 🚀 is 4 bytes (32 bits).
Frequently Asked Questions
hello is 01101000 01100101 01101100 01101100 01101111, which is 5 bytes or 40 bits. With a capital H, Hello starts with 01001000 instead; only the first byte changes.65 is treated as the two characters "6" and "5" and becomes 00110110 00110101. The number 65 in binary is 01000001, which is also the ASCII code for the letter A.