At their core, computers only understand two things: on and off, 1 and 0. From this simple binary system emerges everything we see on screens. Understanding binary illuminates how digital technology fundamentally works.
What Is Binary?
Binary is a base-2 number system using only two digits: 0 and 1. Each digit is called a "bit" (binary digit). Our decimal system uses ten digits (0-9); binary uses two.
Counting in Binary
| Decimal | Binary |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 10 |
| 3 | 11 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
| 8 | 1000 |
Convert binary to text with our binary converter.
Why Computers Use Binary
Electronics work on two states:
- On/High voltage: Represents 1
- Off/Low voltage: Represents 0
This two-state system is reliable, fast, and resistant to electrical noise. Distinguishing between two states is easier than distinguishing between ten.
Binary and Place Values
In decimal, places represent powers of 10:
- 152 = (1×100) + (5×10) + (2×1)
In binary, places represent powers of 2:
- 1011 = (1×8) + (0×4) + (1×2) + (1×1) = 11 in decimal
Powers of 2 to know: 1, 2, 4, 8, 16, 32, 64, 128, 256...
Text as Binary
Characters map to numbers via encoding standards. ASCII assigns:
- A = 65 = 01000001
- B = 66 = 01000010
- a = 97 = 01100001
The word "Hi" in binary (ASCII):
- H = 01001000
- i = 01101001
- Hi = 01001000 01101001
Binary Data Units
- Bit: Single 0 or 1
- Byte: 8 bits (represents 0-255)
- Kilobyte (KB): 1,024 bytes
- Megabyte (MB): 1,024 KB
- Gigabyte (GB): 1,024 MB
- Terabyte (TB): 1,024 GB
Binary Math
Addition
1011 (11)
+ 0110 (6)
------
10001 (17)
Rules: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (carry the 1)
Other Operations
Computers perform all math using binary operations. Multiplication is repeated addition; division is repeated subtraction.
Hexadecimal: Binary's Friend
Writing long binary strings is tedious. Hexadecimal (base-16) provides a compact representation:
- 4 binary digits = 1 hex digit
- 1111 = F, 1010 = A, 0000 = 0
- 11111111 = FF = 255
Color codes like #FF5733 are hex representations of RGB values.
Binary in Everyday Tech
Images
Each pixel is numbers representing red, green, blue values. A 1000×1000 image with 24-bit color = 24 million bits.
Audio
Sound waves are sampled thousands of times per second, each sample stored as binary numbers.
Networking
IP addresses are 32-bit binary numbers. 192.168.1.1 = 11000000.10101000.00000001.00000001
Conversion Tools
- Binary to Text - Decode binary strings
- Text to Binary - Encode text as binary
- Hex to RGB - Color code conversion
Understanding binary provides insight into how all digital technology functions at its most fundamental level.