The formula
Positional notation: value = Σ dᵢ × baseⁱ
- dᵢ
- the digit at position i, counting from zero at the right
- base
- 2 (binary), 8 (octal), 10 (decimal) or 16 (hexadecimal)
Worked example
Convert decimal 255 to the other three bases.
- Binary: 255 = 128+64+32+16+8+4+2+1 → 11111111
- Hex: group the bits in fours — 1111 1111 → F F
- Octal: group in threes from the right — 011 111 111 → 377
255₁₀ = 11111111₂ = FF₁₆ = 377₈ — the largest value a single byte can hold.
Where you'll use it
Digital electronics and microprocessor papers, reading register values and setting bit masks. Hex is popular because one hex digit maps exactly to four bits, so conversion is grouping rather than division.