Converting a decimal number to binary is a basic skill in computing and digital electronics. It is necessary to understand Unix permissions (chmod 755 = 111 101 101), network addresses, bitwise operations and the internal representation of data.

The successive division by 2 method is the simplest for converting decimal to binary. Divide the number by 2 repeatedly, note the remainders (0 or 1) at each step, and read the remainders from bottom to top to get the binary representation. Alternatively, you can subtract successive powers of 2.

๐Ÿ“ Formula

Method: divide by 2 repeatedly โ†’ read remainders from bottom to top

๐Ÿ“Š Reference table

Decimal Binary Verification
0 0 โ€”
1 1 1
5 101 4+1
10 1010 8+2
15 1111 8+4+2+1
16 10000 16
42 101010 32+8+2
100 1100100 64+32+4
255 11111111 128+64+32+16+8+4+2+1

๐Ÿ’ก Practical examples

Example 1: convert 13 to binary 13 รท 2 = 6 remainder 1 โ†’ 6 รท 2 = 3 remainder 0 โ†’ 3 รท 2 = 1 remainder 1 โ†’ 1 รท 2 = 0 remainder 1. Read remainders bottom to top: 1101. Check: 8+4+1 = 13 โœ“
Example 2: Unix chmod 755 permissions 7 โ†’ 111 (rwx), 5 โ†’ 101 (r-x), 5 โ†’ 101 (r-x). chmod 755 in binary = 111 101 101: read-write-execute for owner, read-execute for others.
Example 3: represent an IP byte An IP address byte like 192: 192 = 128+64 = 11000000 in binary. Subnets and CIDR masks rely on this representation.