Convert numbers between different number systems (bases)
A number base (or radix) is the number of unique digits used to represent numbers in a positional numeral system.
Base | Name | Digits | Example |
---|---|---|---|
2 | Binary | 0, 1 | 1010₂ |
8 | Octal | 0-7 | 752₈ |
10 | Decimal | 0-9 | 490₁₀ |
16 | Hexadecimal | 0-9, A-F | 1EA₁₆ |
Each position in a number represents a power of the base:
Example: 1234₁₀ = 1×10³ + 2×10² + 3×10¹ + 4×10⁰
Binary: 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 11₁₀
To Decimal: Multiply each digit by base raised to its position power
From Decimal: Repeatedly divide by target base, collect remainders
Between Non-Decimal: Convert to decimal first, then to target base