↔ 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:

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

BinaryDecimal
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

Example 2: 11010₂1×16 + 1×8 + 0×4 + 1×2 + 0×1 = 26₁₀

Example 3: 1111₂8+4+2+1 = 15₁₀

DecimalBinary
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

Example 2: 25₁₀ → 25÷2=12 r1, 12÷2=6 r0, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → 11001₂

Example 3: 8₁₀ → 1000₂

② Binary ↔ Octal

BinaryOctal
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

Example 2: 11010₂ → group 011 010 → 3,2 → 32₈

Example 3: 1111000₂ → 001 111 000 → 1,7,0 → 170₈

OctalBinary
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

Example 2: 72₈ → 7=111, 2=010 → 111010₂

Example 3: 10₈ → 1=001, 0=000 → 001000₂ (or 1000₂)

③ Binary ↔ Hexadecimal

BinaryHexadecimal
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

Example 2: 1010₂ → 1010 = A → A₁₆

Example 3: 11111111₂ → 1111 1111 → FF₁₆

HexadecimalBinary
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

Example 2: F1₁₆ → F=1111, 1=0001 → 11110001₂

Example 3: 7₂? Actually hex 7 → 0111₂

④ Decimal ↔ Octal

DecimalOctal
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

Example 2: 64₁₀ → 64÷8=8 r0, 8÷8=1 r0, 1÷8=0 r1 → 100₈

Example 3: 20₁₀ → 24₈

OctalDecimal
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

Example 2: 52₈ → 5×8 + 2×1 = 42₁₀

Example 3: 100₈ = 64₁₀

⑤ Decimal ↔ Hexadecimal

DecimalHexadecimal
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 14E (LSB)
  • Step 2: 15 ÷ 16 = 0 remainder 15F (MSB)
  • Read bottom→top: FE
  • Result: 254₁₀ = FE₁₆
Show more examples

Example 2: 100₁₀ → 100÷16=6 r4, 6÷16=0 r6 → 64₁₆

Example 3: 255₁₀ → FF₁₆

HexadecimalDecimal
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

Example 2: FF₁₆ → 15×16 + 15×1 = 255₁₀

Example 3: 10₁₆ = 16₁₀

⑥ Octal ↔ Hexadecimal

There is no direct rule; the easiest way is to convert via binary as an intermediate step.

OctalHexadecimal
  • Example: Convert 45₈ to hex.
  • Step 1: Octal → binary: 4 → 100, 5 → 101100101₂
  • 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₁₆
HexadecimalOctal
  • Example: Convert 2F₁₆ to octal.
  • Step 1: Hex → binary: 2 → 0010, F → 111100101111₂
  • 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
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Use this table to quickly convert between 4‑bit binary, octal, and hex digits.

© 2026 — Number System Conversions · Explained with Examples