Skip to main content
Binary
101010

Binary System Guide

Binary Number System

The binary system uses only two digits: 0 and 1. This is the basic language of computers, where 0 means no electricity (off) and 1 means electricity (on). Binary numbers are longer than decimal, but easier to implement in digital electronics. A byte is 8 bits (e.g., 10101010₂ = 170₁₀).

Converting to Binary

To convert decimal to binary, divide by 2 and record remainders. Example: 42 ÷ 2 = 21 remainder 0, 21 ÷ 2 = 10 remainder 1, 10 ÷ 2 = 5 remainder 0, 5 ÷ 2 = 2 remainder 1, 2 ÷ 2 = 1 remainder 0, 1 ÷ 2 = 0 remainder 1. Reading from bottom: 101010₂ = 42₁₀.

Programming Applications

Binary is used in bit masks, file permissions (e.g., chmod 755 = 111101101), IPv4 addresses, RGB colors (red #FF0000 = 11111111 00000000 00000000). RAM is addressed by bits. Boolean: true=1, false=0.