Binary

Binary is the base-2 positional number system, which writes every quantity using only the digits 0 and 1, with each position worth a power of two instead of a power of ten. It is the number system that digital computers use internally, not because it is mathematically special, but because two clearly separated electrical states are the most reliable thing to build circuits around.

Binary is the same positional idea as everyday counting, with a smaller base. In the number 1101, reading from the right, the places are worth 1, 2, 4, and 8, so the value is 1 × 8 + 1 × 4 + 0 × 2 + 1 × 1 = 13. Counting goes 0, 1, 10, 11, 100, 101, because after the digit 1 comes a carry into the next place, just as 9 rolls over to 10 in the ordinary system. A number with n digits ranges from 0 up to 2^n - 1, so four binary digits reach 15 and eight reach 255. Gottfried Leibniz described this system in his 1703 essay on binary arithmetic and was struck by how few symbols it needed.

Arithmetic in binary follows the familiar schoolbook procedures but with a tiny set of rules. Adding two digits gives 0 + 0 = 0, 0 + 1 = 1, and 1 + 1 = 10, which is a zero written down and a one carried. Adding 1011 (eleven) and 0110 (six) works column by column from the right: 1 + 0 gives 1; 1 + 1 gives 0 carry 1; 0 + 1 + carry gives 0 carry 1; 1 + 0 + carry gives 0 carry 1; and the final carry becomes the leading digit, giving 10001, which is seventeen. Multiplying by two simply shifts every digit one place left, and dividing by two shifts right, which is why shifts are among the cheapest operations a processor offers.

Place values: 8, 4, 2, 1
each place is twice the one to its right
Adding 1011 + 0110
1011
eleven = 8 + 2 + 1
+ 0110
six = 4 + 2
= 10001
seventeen = 16 + 1, with carries rippling left
Negative numbers with two's complement
Start with +5 = 00000101
eight-digit form
Invert every digit: 11111010
swap every 0 and 1
Add one: 11111011
this pattern now means -5
Check: 00000101 + 11111011 = 100000000
the carry out of the top place is discarded, leaving 0

Negative numbers are handled by convention rather than by a minus sign, and the winning convention is two's complement. To negate a value, invert all its digits and add one. In an eight-digit system, 00000101 is +5 and 11111011 is -5, and the sum of the two overflows to zero once the extra carry is dropped. The advantage is that the same adder circuit handles positive and negative numbers with no special cases, and there is only one zero. The range is asymmetric, from -128 to +127 for eight digits. Arithmetic that exceeds the range wraps around, a source of overflow bugs, and a famous example is the Year 2038 problem for time counters held in signed 32-bit seconds.

The case for binary rests on engineering and logic, not on numerical convenience. In 1854 George Boole formalized logic as an algebra of true and false, and in 1937 Claude Shannon's master's thesis showed that Boolean algebra describes switching circuits built from relays, linking logic to hardware. A two-state signal needs only one threshold, so noise has to be large to cause an error, while a ten-level signal would need ten narrow bands. Logic gates built on those two states compute AND, OR, and NOT, and every adder, memory cell, and processor is a network of them. Binary does not make computers faster in itself; it makes them reliable and cheap to build.

Several common misconceptions surround the word. Binary is a number system and not a file type: a "binary file" is simply one meant to be interpreted by a program rather than read as text. Binary also does not mean computers think in ones and zeros; programmers work in languages, and the machine's two-state circuits are an implementation detail. Binary numbers are long to read, so people write them in a shorter grouped notation for convenience, and a related but unrelated term, binary search, means repeatedly halving a sorted list, which takes about 20 steps for a million entries. Conversion between this system and ordinary decimal notation follows simple procedures, with some surprising consequences for fractions.

Read binary as ordinary positional counting with only two symbols — a system whose arithmetic is simple enough to build from switches, and whose conventions for negatives and overflow explain much of how computer numbers behave.

Take binary further

Ask the copilot about this term, or have our engineers assess it against your process.