What is Binary?
Binary (also known as base-2) is a numeral system that uses only two symbols: 0 and 1. It is the fundamental language of computers, where all data and instructions are ultimately represented as sequences of binary digits (bits).
Quick Facts
| Full Name | Binary Number System |
|---|---|
| Created | Ancient origins, computing use from 1940s |
| Specification | Official Specification |
How Binary Works
Binary is the foundation of all digital computing because electronic circuits can easily represent two states: on (1) and off (0). Each binary digit is called a bit, and 8 bits form a byte. Binary arithmetic follows the same principles as decimal but with only two digits, so 1 + 1 = 10 (carrying to the next position). While humans find binary cumbersome for large numbers, computers process it efficiently. Binary is used to represent everything in computers: numbers, text (via ASCII/Unicode), images, audio, and machine instructions.
Key Characteristics
- Base-2 number system using only 0 and 1
- Each digit is called a bit (binary digit)
- 8 bits = 1 byte (256 possible values)
- Directly maps to electronic on/off states
- Foundation of all digital computing
- Powers of 2: 1, 2, 4, 8, 16, 32, 64, 128...
Common Use Cases
- Computer data storage and processing
- Network data transmission
- File encoding and compression
- Bitwise operations in programming
- Digital logic and circuit design
Example
Binary Conversion:
Decimal Binary Calculation
0 0
1 1 2^0 = 1
2 10 2^1 = 2
5 101 4+0+1 = 5
10 1010 8+0+2+0 = 10
255 11111111 128+64+32+16+8+4+2+1
Binary Arithmetic:
1010 (10)
+ 0011 (3)
------
1101 (13)
Bit Positions (8-bit byte):
Position: 7 6 5 4 3 2 1 0
Value: 128 64 32 16 8 4 2 1
Example: 01001011 = 64+8+2+1 = 75
Conversion:
Decimal to Binary: (10).toString(2) = '1010'
Binary to Decimal: parseInt('1010', 2) = 10