↔ Number System Conversions
Binary · Octal · Decimal · Hexadecimal — explained with clear, step‑by‑step examples.
📘 Introduction
A number system defines a set of symbols (digits) and rules for representing numbers.
The four most common systems are:
- Binary (base 2) — digits
0, 1
- Octal (base 8) — digits
0–7
- Decimal (base 10) — digits
0–9
- Hexadecimal (base 16) — digits
0–9 and letters A–F
Converting between these systems is essential in computing and digital electronics.
Below you will find every possible inter‑conversion, each with a worked example.
① Binary ↔ Decimal
Binary → Decimal
Rule: Multiply each bit by 2position (starting from 0 at the rightmost) and sum.
- Example: Convert 10112 to decimal.
- Step 1: Write powers of 2: 2³, 2², 2¹, 2⁰ → 8, 4, 2, 1
- Step 2: Multiply each bit: 1×8 + 0×4 + 1×2 + 1×1
- Step 3: Sum = 8 + 0 + 2 + 1 = 11
- Result: 1011₂ = 11₁₀
Show more examples
Decimal → Binary
Rule: Repeatedly divide by 2, recording remainders from bottom to top.
- Example: Convert 13₁₀ to binary.
- Step 1: 13 ÷ 2 = 6 remainder 1 (LSB)
- Step 2: 6 ÷ 2 = 3 remainder 0
- Step 3: 3 ÷ 2 = 1 remainder 1
- Step 4: 1 ÷ 2 = 0 remainder 1 (MSB)
- Read remainders bottom→top: 1101
- Result: 13₁₀ = 1101₂
Show more examples
② Binary ↔ Octal
Binary → Octal
Rule: Group binary digits in sets of 3 from the right, pad left with zeros if needed.
Convert each group to its octal digit (0–7).
- Example: Convert 1011011₂ to octal.
- Step 1: Group from right: 1 011 011 (add leading zero → 001 011 011)
- Step 2: Convert each group: 001→1, 011→3, 011→3
- Result: 1011011₂ = 133₈
Show more examples
Octal → Binary
Rule: Replace each octal digit with its 3‑bit binary equivalent.
- Example: Convert 56₈ to binary.
- Step 1: 5 → 101 (since 5₁₀ = 101₂)
- Step 2: 6 → 110
- Step 3: Concatenate: 101 110
- Result: 56₈ = 101110₂
Show more examples
③ Binary ↔ Hexadecimal
Binary → Hexadecimal
Rule: Group binary digits in sets of 4 from the right, pad left if needed.
Convert each group to hex (0–9, A–F).
- Example: Convert 11010110₂ to hex.
- Step 1: Group from right: 1101 0110
- Step 2: Convert: 1101 → D (13), 0110 → 6
- Result: 11010110₂ = D6₁₆
Show more examples
Hexadecimal → Binary
Rule: Replace each hex digit with its 4‑bit binary equivalent.
- Example: Convert 3A₁₆ to binary.
- Step 1: 3 → 0011
- Step 2: A (10) → 1010
- Step 3: Concatenate: 0011 1010
- Result: 3A₁₆ = 111010₂ (leading zeros omitted)
Show more examples
④ Decimal ↔ Octal
Decimal → Octal
Rule: Repeatedly divide by 8, record remainders from bottom to top.
- Example: Convert 95₁₀ to octal.
- Step 1: 95 ÷ 8 = 11 remainder 7 (LSB)
- Step 2: 11 ÷ 8 = 1 remainder 3
- Step 3: 1 ÷ 8 = 0 remainder 1 (MSB)
- Read bottom→top: 137
- Result: 95₁₀ = 137₈
Show more examples
Octal → Decimal
Rule: Multiply each digit by 8position and sum.
- Example: Convert 237₈ to decimal.
- Step 1: Write powers: 8²=64, 8¹=8, 8⁰=1
- Step 2: Multiply: 2×64 + 3×8 + 7×1
- Step 3: Sum = 128 + 24 + 7 = 159
- Result: 237₈ = 159₁₀
Show more examples
⑤ Decimal ↔ Hexadecimal
Decimal → Hexadecimal
Rule: Repeatedly divide by 16, record remainders (10–15 as A–F), bottom to top.
- Example: Convert 254₁₀ to hexadecimal.
- Step 1: 254 ÷ 16 = 15 remainder 14 → E (LSB)
- Step 2: 15 ÷ 16 = 0 remainder 15 → F (MSB)
- Read bottom→top: FE
- Result: 254₁₀ = FE₁₆
Show more examples
Hexadecimal → Decimal
Rule: Multiply each digit by 16position (A=10, B=11, … F=15) and sum.
- Example: Convert 1A₃₁₆ to decimal.
- Step 1: Write powers: 16²=256, 16¹=16, 16⁰=1
- Step 2: A = 10, so 1×256 + 10×16 + 3×1
- Step 3: Sum = 256 + 160 + 3 = 419
- Result: 1A3₁₆ = 419₁₀
Show more examples
⑥ Octal ↔ Hexadecimal
There is no direct rule; the easiest way is to convert via binary as an intermediate step.
Octal → Hexadecimal
- Example: Convert 45₈ to hex.
- Step 1: Octal → binary: 4 → 100, 5 → 101 → 100101₂
- Step 2: Group binary in 4s from right: 10 0101 → pad left: 0010 0101
- Step 3: Convert groups: 0010 → 2, 0101 → 5
- Result: 45₈ = 25₁₆
Hexadecimal → Octal
- Example: Convert 2F₁₆ to octal.
- Step 1: Hex → binary: 2 → 0010, F → 1111 → 00101111₂
- Step 2: Group binary in 3s from right: 0 010 111 1 → pad left: 000 010 111 100 (or 0 010 111 100)
- Step 3: Convert groups: 000→0, 010→2, 111→7, 100→4
- Result: 2F₁₆ = 274₈
📊 Quick Reference – Digit Equivalents
| Decimal |
Binary (4‑bit) |
Octal |
Hexadecimal |
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Use this table to quickly convert between 4‑bit binary, octal, and hex digits.
© 2026 — Number System Conversions · Explained with Examples