Computer & IT Fundamentals

Binary Numbers

The base-2 number system computers use, written with only 0 and 1.

Educational explanation, not professional design advice. Last reviewed 24 October 2026. Disclaimer

In plain English

We count in tens because we have ten fingers: after 9 comes 10. Computers count with switches that are either off or on, so they use only two digits, 0 and 1. That is the binary system. Each binary digit is a bit, and eight bits make a byte.

Technical definition

Binary is the positional number system with base 2. Each digit position represents a power of two: 1, 2, 4, 8, 16 and so on from the right. The value of a binary number is the sum of the powers of two where a 1 appears. A bit is a binary digit; a byte is a group of 8 bits (IEC 80000-13 calls this the octet when the size must be unambiguous).

How it works and where it is used

Digital circuits store each bit as a voltage, a charge or a magnetic direction. Groups of bits represent numbers, letters (through character codes such as ASCII and Unicode), colours and instructions. Because long binary strings are hard to read, programmers group them in fours and write each group as one hexadecimal digit (0–9, A–F): one byte is exactly two hex digits.

Formula

Value = Σ bi × 2i    (i = 0 for the rightmost bit)

n bits can represent 2n different values: 0 to 2n − 1

bi = the bit (0 or 1) in position i. To convert decimal to binary, divide repeatedly by 2 and read the remainders from last to first.

Worked example

  • Binary to decimal: 1011₂ = 1×8 + 0×4 + 1×2 + 1×1 = 11.
  • Decimal to binary: 13 ÷ 2 = 6 r1; 6 ÷ 2 = 3 r0; 3 ÷ 2 = 1 r1; 1 ÷ 2 = 0 r1 → reading upwards, 1101₂.
  • Byte and hex: 1111 0000₂ = F0₁₆ = 240. One byte holds 2⁸ = 256 values, 0–255.

In the workshop and in practice

Binary underlies everything digital: PLC inputs and outputs are bits, IP addresses and subnet masks are 32-bit numbers, file sizes are counted in bytes, and CNC and robot controllers store parameters and status flags as bit patterns. Understanding binary makes it easier to read diagnostic codes and register values.

Common mistakes and misconceptions

  • Reading place values from the wrong end. The rightmost bit is worth 1.
  • Confusing bits and bytes. Network speeds are usually in bits per second (Mbit/s); file sizes in bytes (MB). 1 byte = 8 bits.
  • Mixing decimal and binary prefixes. 1 kB = 1000 bytes, while 1 KiB = 1024 bytes (IEC 80000-13).

Related calculators

Related topics

References

  • IEC 80000-13: Quantities and units — Information science and technology (bit, byte, binary prefixes)
  • D. Patterson and J. Hennessy, Computer Organization and Design
  • C. Petzold, Code: The Hidden Language of Computer Hardware and Software