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

Decimal255
Roman numeralsCCLV
HexadecimalFF
Octal377
Duodecimal193
Ternary100110
Base 3673
VigesimalCF

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

BinaryDecimalRoman numeralsHexadecimalOctal
0 0–00
1 1I11
10 2II22
11 3III33
100 4IV44
101 5V55
110 6VI66
111 7VII77
1000 8VIII810
1001 9IX911
1010 10XA12
1011 11XIB13
1100 12XIIC14
1101 13XIIID15
1110 14XIVE16
1111 15XVF17
10000 16XVI1020
10001 17XVII1121
10010 18XVIII1222
10011 19XIX1323
10100 20XX1424
100000 32XXXII2040
110010 50L3262
1000000 64LXIV40100
1100100 100C64144
10000000 128CXXVIII80200
11111111 255CCLVFF377
100000000 256CCLVI100400
111110100 500D1F4764
1111101000 1000M3E81750
10000000000 1024MXXIV4002000

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

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.