How Does Binary Code Work? Step-by-Step Guide
Computers store and process all digital information using the binary numeral system (base-2), which consists entirely of zeros (0) and ones (1). At the hardware level, these numbers correspond directly to electrical transistors being switched off (0) or on (1). Each individual 0 or 1 is called a bit (binary digit), and a standard cluster of eight bits forms a byte.
How Text Converts into Binary (ASCII Standard)
Under the standardized American Standard Code for Information Interchange (ASCII) specification, every printable keyboard character is assigned an integer between 0 and 127. That decimal integer is then converted into base-2 binary notation:
| Character | ASCII Decimal | 8-Bit Binary Representation | Formula (Powers of 2) |
|---|---|---|---|
A (Uppercase) |
65 | 01000001 |
64 + 1 |
B (Uppercase) |
66 | 01000010 |
64 + 2 |
C (Uppercase) |
67 | 01000011 |
64 + 2 + 1 |
a (Lowercase) |
97 | 01100001 |
64 + 32 + 1 |
b (Lowercase) |
98 | 01100010 |
64 + 32 + 2 |
Space (Blank) |
32 | 00100000 |
32 |
! (Exclamation) |
33 | 00100001 |
32 + 1 |
How to Manually Convert Decimal Numbers to Binary
To convert any decimal number into an 8-bit byte manually, evaluate the powers of two from left to right: 128, 64, 32, 16, 8, 4, 2, 1:
- Start with the character's ASCII number (e.g., lowercase
m= 109). - Does 128 fit in 109? No →
0(remainder 109). - Does 64 fit in 109? Yes →
1(remainder 109 - 64 = 45). - Does 32 fit in 45? Yes →
1(remainder 45 - 32 = 13). - Does 16 fit in 13? No →
0(remainder 13). - Does 8 fit in 13? Yes →
1(remainder 13 - 8 = 5). - Does 4 fit in 5? Yes →
1(remainder 5 - 4 = 1). - Does 2 fit in 1? No →
0(remainder 1). - Does 1 fit in 1? Yes →
1(remainder 0).
Result: m = 01101101.
Popular Secret Phrases in Binary Code
• Hello: 01001000 01100101 01101100 01101100 01101111
• I Love You: 01001001 00100000 01101100 01101111 01110110 01100101 00100000 01111001 01101111 01110101
• Good Luck: 01000111 01101111 01101111 01100100 00100000 01001100 01110101 01100011 01101011
🛠️ Related Text & Coding Tools
Check out our other developer utilities and text generators: