Binary (base 2)
Binary is the base-2 number system, which writes every number with just two digits, 0 and 1.
Convert binary to any number system
11111111 binary = 255 decimal
Quick facts
- System
- Binary
- Base (radix)
- 2
- Digits
0 1- Notes
- Two digits, 0 and 1 (bits).
- Also called
- base 2, bin, 0b prefix
- Example
11111111= 255 in decimal
11111111 in other systems
| Decimal | 255 |
| Roman numerals | CCLV |
| Hexadecimal | FF |
| Octal | 377 |
| Duodecimal | 193 |
| Ternary | 100110 |
| Base 36 | 73 |
| Vigesimal | CF |
How binary works
Binary is the base-2 number system, which writes every number with just two digits, 0 and 1. Each position is worth twice the one to its right: 1, 2, 4, 8, 16, 32 and so on. The binary number 1010 is 8 + 2 = 10.
Each binary digit is called a bit, and eight bits make a byte, which can hold values from 0 (00000000) to 255 (11111111). In programming, binary literals are often written with a 0b prefix, as in 0b1010.
Each position is worth 2 times the position to its right: 1, 2, 4, 8, 16 and so on. So 11111111 means 1 × 27 + 1 × 26 + 1 × 25 + 1 × 24 + 1 × 23 + 1 × 22 + 1 × 21 + 1 × 20 = 255.
Where binary is used
- All digital computers and electronics store and process data in binary.
- Network masks and IP addresses (255.255.255.0 is 24 ones followed by 8 zeros).
- File permissions, flags and bit masks in programming.
- Digital logic design and computer science education.
Binary chart
| Binary | Decimal | Roman numerals | Hexadecimal | Octal |
|---|---|---|---|---|
0 |
0 | – | 0 | 0 |
1 |
1 | I | 1 | 1 |
10 |
2 | II | 2 | 2 |
11 |
3 | III | 3 | 3 |
100 |
4 | IV | 4 | 4 |
101 |
5 | V | 5 | 5 |
110 |
6 | VI | 6 | 6 |
111 |
7 | VII | 7 | 7 |
1000 |
8 | VIII | 8 | 10 |
1001 |
9 | IX | 9 | 11 |
1010 |
10 | X | A | 12 |
1011 |
11 | XI | B | 13 |
1100 |
12 | XII | C | 14 |
1101 |
13 | XIII | D | 15 |
1110 |
14 | XIV | E | 16 |
1111 |
15 | XV | F | 17 |
10000 |
16 | XVI | 10 | 20 |
10001 |
17 | XVII | 11 | 21 |
10010 |
18 | XVIII | 12 | 22 |
10011 |
19 | XIX | 13 | 23 |
10100 |
20 | XX | 14 | 24 |
100000 |
32 | XXXII | 20 | 40 |
110010 |
50 | L | 32 | 62 |
1000000 |
64 | LXIV | 40 | 100 |
1100100 |
100 | C | 64 | 144 |
10000000 |
128 | CXXVIII | 80 | 200 |
11111111 |
255 | CCLV | FF | 377 |
100000000 |
256 | CCLVI | 100 | 400 |
111110100 |
500 | D | 1F4 | 764 |
1111101000 |
1000 | M | 3E8 | 1750 |
10000000000 |
1024 | MXXIV | 400 | 2000 |
History
Gottfried Wilhelm Leibniz described modern binary arithmetic in 1703, noting its similarity to the hexagrams of the Chinese I Ching. George Boole's algebra of logic (1854) and Claude Shannon's 1937 thesis linking it to electrical switches made binary the language of modern computers.
Convert binary to…
Convert to binary
Numbers in binary
- 0
- 1
- 10
- 11
- 100
- 101
- 110
- 111
- 1000
- 1001
- 1010
- 1011
- 1100
- 1101
- 1110
- 1111
- 10000
- 10001
- 10010
- 10011
- 10100
- 10101
- 10110
- 10111
- 11000
- 11001
- 11010
- 11011
- 11100
- 11101
- 11110
- 11111
- 100000
- 100001
- 100010
- 100011
- 100100
- 100101
- 100110
- 100111
- 101000
- 101001
- 101010
- 101011
- 101100
- 101101
- 101110
- 101111
- 110000
- 110001
- 110010
- 110011
- 110100
- 110101
- 110110
- 110111
- 111000
- 111001
- 111010
- 111011
- 111100
- 111101
- 111110
- 111111
- 1000000
- 1000001
- 1000010
- 1000011
- 1000100
- 1000101
- 1000110
- 1000111
- 1001000
- 1001001
- 1001010
- 1001011
- 1001100
- 1001101
- 1001110
- 1001111
- 1010000
- 1010001
- 1010010
- 1010011
- 1010100
- 1010101
- 1010110
- 1010111
- 1011000
- 1011001
- 1011010
- 1011011
- 1011100
- 1011101
- 1011110
- 1011111
- 1100000
- 1100001
- 1100010
- 1100011
- 1100100
- 10000000
- 11001000
- 100000000
- 100101100
- 110010000
- 111110100
- 1000000000
- 1001011000
- 1010111100
- 1100100000
- 1110000100
- 1111101000
- 10000000000
Frequently asked questions
What is binary?
Binary is the base-2 number system, which writes every number with just two digits, 0 and 1.
Which symbols does binary use?
Two digits, 0 and 1 (bits).
How do you write 10 in binary?
10 in binary is 1010.
How do you write 100 in binary?
100 in binary is 1100100.