Any information processed by a computer or transmitted over a network is represented in binary form. An understanding of the binary number system is essential for understanding IP addressing, subnet masks and network protocols.

1. The binary system

The binary system uses only two digits: 0 and 1. In electronics, these digits can be represented by two states: no voltage (0) and voltage present (1), or by light pulses (0 = no light, 1 = light). A binary number is read from right to left (least significant bit on the right).

Each digit in a binary number represents a power of 2. To convert a decimal number to binary, we identify the powers of 2 whose sum equals the desired number:

2⁷ = 128

2⁶ = 64

2⁵ = 32

2⁴ = 16

2³ = 8

2² = 4

2¹ = 2

2⁰ = 1

1

1

0

0

0

0

0

0

Example: 192 = 128 + 64 = 11000000 in binary

📄 Decimal ↔ binary conversions

192 = 128+64 → 11000000 | 255 = 128+64+32+16+8+4+2+1 → 11111111 | 10 = 8+2 → 00001010 | 172 = 128+32+8+4 → 1010 1100. These values are fundamental in networking: 192.168.0.0 is the prefix for Class C private networks, 255.255.255.0 is the /24 subnet mask, and 10.0.0.0 is the prefix for Class A private networks.

 

2. The bits

A bit (Binary Digit) is a basic unit of information that can take on two values: 0 or 1. It is the fundamental unit of digital information. Network speed is measured in bits per second (bps, kbps, Mbps, Gbps, Tbps).

It is through sequences of bits that we are able to encode information. The greater the number of bits, the greater the amount of information that can be encoded: n bits can encode 2^n different values.

Bus width / encoding

Number of values

Application

8 bits

2⁸ = 256

Extended ASCII, byte, IPv4 (each address byte)

16 bits

2¹⁶ = 65 536

Unicode BMP, TCP/UDP port numbers (0–65,535)

32 bits

2³² = 4.29 billion

IPv4 addresses, 32-bit integers

48 bits

2⁴⁸ = 281 billions

Ethernet MAC addresses

64 bits

2⁶⁴ = 18,4 × 10¹⁸

64-bit integers, modern CPUs

128 bits

2¹²⁸ = 3,4 × 10³⁸

IPv6 addresses

 

3. The octet

A byte is a group of 8 bits capable of encoding 2⁸ = 256 different values (from 0 to 255). In computing, the byte is the basic unit of memory and storage. Beware of a common confusion: network speeds are measured in bits per second (lowercase b), whilst file sizes are measured in bytes (uppercase B).

📄 ASCII encoding

The ASCII code (American Standard Code for Information Interchange) encodes characters using 7 bits (128 characters), extended to 8 bits for accented characters. A = 65 decimal = 01000001 binary. B = 66 decimal = 01000010 binary. Network protocols use ASCII or its successor Unicode (UTF-8) to encode textual information (DNS domain names, HTTP headers, etc.).

 

4. Hexadecimal representation

In networking, hexadecimal notation (base 16, digits 0–9 and A–F) is frequently used because it allows a group of 4 bits (a nibble) to be represented by a single character, and a byte by two hexadecimal characters. This is the format used for MAC addresses (6 bytes: AA:BB:CC:DD:EE:FF) and IPv6 addresses (16 bytes: 2001:0db8:85a3:0000:0000:8a2e:0370:7334).

Modifié le: vendredi 9 octobre 2026, 09:49