Glossary Data & Encoding

Binary

Binary is the base-2 number system, using only the digits 0 and 1, which computers use because electronic circuits are either off or on.

Last reviewed:

AdSense Placeholder
Slot: header_reference_page

In more detail

Each binary digit is a bit; each column is worth twice the one to its right (1, 2, 4, 8, 16...). Eight bits make a Byte and can hold 0 to 255. Negative numbers are usually stored in two's complement, where the same eight bits 11111111 mean −1 and a signed byte covers −128 to 127. People usually write binary data in Hexadecimal, a shorter way to say the same bits. See How Number Bases Work: Binary, Octal and Hex.

Why it matters

Binary explains many everyday limits and settings: why values stop at 255 or 65,535, why a Subnet mask such as 255.255.255.0 is 24 ones followed by 8 zeros, and how flags and permissions pack several on/off options into one number. Reading a value as signed when it was meant as unsigned (or the reverse) turns 255 into −1, a classic source of bugs.

Example

Decimal 202 is 128 + 64 + 8 + 2, so it is 11001010 in binary. Reading it back: 1×128 + 1×64 + 0×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1 = 202. In hex the same byte is CA.

AdSense Placeholder
Slot: footer_leaderboard