Base Conversion Formula – Positional Notation & Repeated Division

The general two-step base conversion formula: positional notation (any base to decimal) and repeated division (decimal to any base), with complete variable definitions and three worked examples.

Formula
Converting a number from source base B to target base C uses two formulas in sequence. First, positional notation converts the source to decimal: each digit is multiplied by B raised to its position and the products are summed. Second, the repeated-division algorithm converts that decimal value to base C: divide by C repeatedly, collect remainders, and read them from last to first. Direct bit-grouping shortcuts apply for conversions between binary, octal, and hexadecimal.
Variables
SymbolNameDescriptionUnit
BSource baseThe radix of the input number — the number of unique digits it uses. Binary: B=2, octal: B=8, decimal: B=10, hex: B=16
CTarget baseThe radix to convert to. The repeated-division algorithm divides by C at each step until the quotient reaches 0
dᵢSource digit at pos iThe face value of the digit at position i in base B. Must satisfy 0 ≤ dᵢ < B. For hex source: A=10, B=11, C=12, D=13, E=14, F=15
N₁₀Decimal intermediateThe decimal value computed in Step 1. This is the bridge between the two bases — it has a unique decimal representation regardless of source or target base
rₖRemainder at step kOne digit of the base-C result. r₀ is the least significant digit; the final remainder is the most significant. For target base 16: rₖ values 10–15 are written as A–F
How to Use
  1. Step 1 (Source → Decimal): label each source digit's position from 0 (rightmost). Compute N₁₀ = Σ dᵢ × B^i for all positions.
  2. Step 2 (Decimal → Target): divide N₁₀ by C. Record the remainder r₀. Divide the quotient by C. Record remainder r₁. Continue until the quotient is 0.
  3. Read all remainders from last to first — this sequence is the result in base C.
  4. Shortcut for binary ↔ octal: group binary into 3-bit chunks (octal→binary: expand each digit to 3 bits). No decimal step needed.
  5. Shortcut for binary ↔ hex: group binary into 4-bit chunks (hex→binary: expand each digit to 4 bits). No decimal step needed.
  6. Shortcut for octal ↔ hex: go via binary — expand octal digits to 3-bit groups to get binary, then regroup into 4-bit hex groups (or vice versa).
Examples
1. Convert (374)₈ to hexadecimal via decimal (two-step method)

Step 1 — (374)₈ to decimal using positional notation:

Step 2 — 252₁₀ to hexadecimal using repeated division by 16:

Dividend÷ 16QuotientRemainder
252÷ 1615C (12)
15÷ 160F (15)
(374)₈ = (FC)₁₆. Verify: 15×16 + 12 = 252₁₀ ✓
2. Convert (374)₈ to hexadecimal via binary shortcut

Step 1: expand each octal digit to 3 bits — 3=011, 7=111, 4=100 → binary 011111100 (9 bits).

Step 2: pad to 12 bits → 000011111100. Split into 4-bit groups: 0000 | 1111 | 1100.

4-bit group000011111100
Hex digit0 (drop)FC
(374)₈ = (FC)₁₆ — same answer as Example 1, but no division required.
3. Convert (D7E)₁₆ to octal via binary shortcut

Step 1: expand each hex digit to 4 bits — D=1101, 7=0111, E=1110 → binary 110101111110 (12 bits).

Step 2: 12 bits is already a multiple of 3. Split into 3-bit groups: 110 | 101 | 111 | 110.

3-bit group110101111110
Octal digit6576
(D7E)₁₆ = (6576)₈. Verify: 13×256 + 7×16 + 14 = 3454₁₀. And 6×512 + 5×64 + 7×8 + 6 = 3072+320+56+6 = 3454₁₀ ✓