Text to Binary Converter
Convert text to binary code using ASCII/UTF-8 encoding. Live conversion as you type.
What Is Binary?
Binary is a base-2 number system that uses only two digits: 0 and 1. Unlike our everyday decimal system (base-10) which uses digits 0–9, binary represents all values using combinations of just these two states. In electronics, these correspond to "off" (0) and "on" (1) — the fundamental voltage states in digital circuits.
Every piece of data in a computer — text, images, video, music, software — is ultimately stored and processed as binary. When you type "Hello" on your keyboard, the computer converts each letter into a specific binary pattern, processes it, stores it, and converts it back to display on screen.
Why Computers Use Binary
Computers use binary because electronic circuits have two reliable states: high voltage (1) and low voltage (0). This makes binary extremely robust against electrical noise — a circuit only needs to distinguish between "on" and "off," not between ten different voltage levels. This reliability allows billions of operations per second without errors.
Bits and Bytes
- Bit (b): The smallest unit of data — a single 0 or 1. Can represent two states (on/off, true/false, yes/no).
- Nibble: 4 bits. Can represent values 0–15 (one hexadecimal digit).
- Byte (B): 8 bits. Can represent 256 values (0–255). One ASCII character = 1 byte.
- Kilobyte (KB): 1,024 bytes. A short email is roughly 2–5 KB.
- Megabyte (MB): 1,024 KB (~1 million bytes). An MP3 song is 3–5 MB.
- Gigabyte (GB): 1,024 MB (~1 billion bytes). A movie is 1–4 GB.
How Text Is Stored in Computers
Computers don't understand letters directly. Every character must be mapped to a number, and that number is stored in binary. The mapping systems (character encodings) define which number represents which character.
The Encoding Process
- You type a character (e.g., "A")
- The encoding standard assigns it a code point number (ASCII: 65, Unicode: U+0041)
- The encoding format converts that number to binary bytes (UTF-8: 01000001)
- The binary is stored in memory/disk as electrical charges or magnetic states
- When displayed, the reverse process maps binary → number → character glyph
Worked Example: "Hello"
| Character | ASCII Code | Binary (8-bit) | Hex |
|---|---|---|---|
| H | 72 | 01001000 | 48 |
| e | 101 | 01100101 | 65 |
| l | 108 | 01101100 | 6C |
| l | 108 | 01101100 | 6C |
| o | 111 | 01101111 | 6F |
So "Hello" in binary = 01001000 01100101 01101100 01101100 01101111 (40 bits = 5 bytes)
ASCII vs Unicode vs UTF-8
| Feature | ASCII | Unicode | UTF-8 |
|---|---|---|---|
| Characters supported | 128 (7-bit) | 149,000+ code points | All Unicode characters |
| English letters | ✅ | ✅ | ✅ |
| Emoji | ❌ | ✅ | ✅ |
| Hindi, Arabic, Chinese | ❌ | ✅ | ✅ |
| Bytes per character | 1 byte (always) | 2–4 bytes (UTF-16) | 1–4 bytes (variable) |
| Backward compatible with ASCII | N/A | ❌ (different encoding) | ✅ (first 128 chars identical) |
| Web standard | Legacy | Standard (abstract) | Default for HTML5, JSON, APIs |
| When to use | Simple English text only | Internal processing | Storage, transmission, web |
Binary vs Hexadecimal
| Aspect | Binary | Hexadecimal |
|---|---|---|
| Base | Base-2 | Base-16 |
| Digits used | 0, 1 | 0–9, A–F |
| Representation of 255 | 11111111 (8 digits) | FF (2 digits) |
| Human readability | Low (long strings) | Medium (compact) |
| Computer native | Yes (hardware level) | No (shorthand for binary) |
| Common use | Machine code, digital logic | Memory addresses, colors (#FF0000), MAC addresses |
| Conversion | 4 binary digits = 1 hex digit | 1 hex digit = 4 binary digits |
Hexadecimal is essentially a shorthand for binary. Since each hex digit maps to exactly 4 binary digits, programmers use hex to represent binary data more compactly. For example: binary 11111111 = hex FF = decimal 255.
Real-World Applications of Binary Encoding
💻 Computer Programming
All source code is stored as binary. Compilers convert human-readable code into binary machine instructions. Understanding binary helps debug bitwise operations, memory addresses, and data structures.
🌐 Networking & Data Transmission
Every byte sent over the internet travels as binary electrical/optical signals. Network protocols (TCP/IP, HTTP) define how binary data is structured, addressed, and error-checked during transmission.
💾 Data Storage
Hard drives store data as magnetic orientation (N/S = 0/1). SSDs use electrical charges in flash cells. RAM holds data as capacitor voltage states. All fundamentally binary.
🔐 Cybersecurity & Cryptography
Encryption algorithms (AES, RSA) operate on binary data. Hash functions produce binary digests. Understanding binary is essential for analyzing malware, reverse engineering, and security research.
🤖 Embedded Systems & IoT
Microcontrollers in IoT devices, cars, and appliances process binary instructions directly. Firmware is written in binary-compiled code. Sensor data is digitized into binary values for processing.
📱 Digital Electronics
Logic gates (AND, OR, NOT, XOR) operate on binary inputs. Digital circuits in CPUs perform billions of binary operations per second. Understanding binary is foundational to hardware design.
🎓 Computer Science Education
Binary is taught in every CS curriculum. It's essential for understanding data types, memory management, floating-point arithmetic, character encoding, and algorithm complexity.
🎮 Game Development
Games use binary operations for collision detection (bitmasks), state management (bitflags), and efficient data packing. Understanding binary helps optimize game performance.
ASCII to Binary Reference Table
Complete reference for converting printable ASCII characters (32–126) to binary:
| Char | Dec | Binary | Char | Dec | Binary | Char | Dec | Binary |
|---|---|---|---|---|---|---|---|---|
| Space | 32 | 00100000 | @ | 64 | 01000000 | ` | 96 | 01100000 |
| ! | 33 | 00100001 | A | 65 | 01000001 | a | 97 | 01100001 |
| " | 34 | 00100010 | B | 66 | 01000010 | b | 98 | 01100010 |
| # | 35 | 00100011 | C | 67 | 01000011 | c | 99 | 01100011 |
| $ | 36 | 00100100 | D | 68 | 01000100 | d | 100 | 01100100 |
| % | 37 | 00100101 | E | 69 | 01000101 | e | 101 | 01100101 |
| & | 38 | 00100110 | F | 70 | 01000110 | f | 102 | 01100110 |
| ' | 39 | 00100111 | G | 71 | 01000111 | g | 103 | 01100111 |
| ( | 40 | 00101000 | H | 72 | 01001000 | h | 104 | 01101000 |
| ) | 41 | 00101001 | I | 73 | 01001001 | i | 105 | 01101001 |
| * | 42 | 00101010 | J | 74 | 01001010 | j | 106 | 01101010 |
| + | 43 | 00101011 | K | 75 | 01001011 | k | 107 | 01101011 |
| , | 44 | 00101100 | L | 76 | 01001100 | l | 108 | 01101100 |
| - | 45 | 00101101 | M | 77 | 01001101 | m | 109 | 01101101 |
| . | 46 | 00101110 | N | 78 | 01001110 | n | 110 | 01101110 |
| / | 47 | 00101111 | O | 79 | 01001111 | o | 111 | 01101111 |
| 0 | 48 | 00110000 | P | 80 | 01010000 | p | 112 | 01110000 |
| 1 | 49 | 00110001 | Q | 81 | 01010001 | q | 113 | 01110001 |
| 2 | 50 | 00110010 | R | 82 | 01010010 | r | 114 | 01110010 |
| 3 | 51 | 00110011 | S | 83 | 01010011 | s | 115 | 01110011 |
| 4 | 52 | 00110100 | T | 84 | 01010100 | t | 116 | 01110100 |
| 5 | 53 | 00110101 | U | 85 | 01010101 | u | 117 | 01110101 |
| 6 | 54 | 00110110 | V | 86 | 01010110 | v | 118 | 01110110 |
| 7 | 55 | 00110111 | W | 87 | 01010111 | w | 119 | 01110111 |
| 8 | 56 | 00111000 | X | 88 | 01011000 | x | 120 | 01111000 |
| 9 | 57 | 00111001 | Y | 89 | 01011001 | y | 121 | 01111001 |
| : | 58 | 00111010 | Z | 90 | 01011010 | z | 122 | 01111010 |