In computer science and mathematics, binary is a system where numbers and values are expressed 0 or 1.

Binary is base-2, meaning that it only uses two digits or bits. For computers, 1 is true or "on", and 0 is false or "off".

The concept of binary and bits are based on of Boolean Algebra.

The binary number system is positional. So even though it only works with 1's and 0's, the position of those two digits can represent much more.

For example, here are the numbers 0 to 10 in binary:

Decimal NumberBinary Number
00
11
210
311
4100
5101
6110
7111
81000
91001
101010

And things like ASCII work with binary under the hood.

In fact, while computers work with all sorts of different input and output, at their core, they work entirely with binary.

To get a high-level overview of how computers work and binary is used, check out this video:

Image