Every number system describes the same value differently. 42 in decimal,
101010 in binary, 52 in octal, 2A in hex — all the same quantity,
four different languages. Conversion is just translation.
Decimal → Any Base
Divide repeatedly by the target base. Read the remainders bottom to top.
42 to binary (base-2):
42 ÷ 2 = 21 r 0
21 ÷ 2 = 10 r 1
10 ÷ 2 = 5 r 0
5 ÷ 2 = 2 r 1
2 ÷ 2 = 1 r 0
1 ÷ 2 = 0 r 1
Read up: 101010 ✓
Same method works for octal (divide by 8) and hex (divide by 16).
Any Base → Decimal
Multiply each digit by its positional power. Sum the results.
101010 from binary:
0 × 1+1 × 2+0 × 4+1 × 8+0 × 16+1 × 32- =
0 + 2 + 0 + 8 + 0 + 32=42✓
Binary ↔ Octal
Group binary digits in threes from the right. Each group is one octal digit.
101010 → 101 010 → 5 2 → 52 ✓
Reverse: expand each octal digit into three binary digits.
Binary ↔ Hex
Group binary digits in fours from the right. Each group is one hex digit.
101010 → 0010 1010 → 2 A → 2A ✓
Reverse: expand each hex digit into four binary digits.
The Pattern
To decimal — positional multiplication, then sum. From decimal — repeated division, remainders read upward. Binary ↔ Octal — groups of three. Binary ↔ Hex — groups of four.
Octal and hex exist because binary is exhausting to read. Conversion is the bridge — and binary is always the middle ground.