What is a number base?
A number base is the number of different digits a system uses. Everyday numbers are in base 10 (digits 0–9). Computers work in base 2, or binary, with just 0 and 1, and programmers also use octal (base 8, digits 0–7) and hexadecimal (base 16, digits 0–9 plus A–F).
The base only changes how a quantity is written, not the quantity itself. The value eleven is 11 in decimal, 1011 in binary, 13 in octal and B in hexadecimal — four labels for the same amount.
How to use this base converter
- Choose the system of your input in the From base dropdown: Decimal (10), Binary (2), Octal (8) or Hexadecimal (16).
- Type the value in the input box, for example 255 or 1011.
- Press Convert.
- Read all four results at once: the same value shown in Binary (2), Octal (8), Decimal (10) and Hexadecimal (16).
How the conversion works
Every system is positional: each digit is worth its face value times the base raised to its position, counting from 0 on the right. That single rule converts any base to decimal.
d₂ d₁ d₀ (base b) = d₂×b² + d₁×b¹ + d₀×b⁰Example 1: binary 1011 to decimal
Apply the rule with b = 2: 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11. So the binary number 1011 and the decimal number 11 are the same quantity.
1011₂ = 11₁₀
Example 2: decimal 45 to binary, hex and octal
Build 45 from powers of 2: 32 + 8 + 4 + 1 = 45. Placing 1s in those positions gives 101101₂. In hexadecimal, 45 = 2×16 + 13, and 13 is the letter D, so it is 2D₁₆. In octal, 45 = 5×8 + 5, so it is 55₈.
45 = 101101₂ = 55₈ = 2D₁₆
Example 3: hex FF to decimal
F is worth 15, so FF = 15×16 + 15 = 240 + 15 = 255. This is why FF shows up everywhere as the maximum of one byte, for example pure white in RGB color codes.
FF₁₆ = 255₁₀
Tips and common mistakes
Check your digits against the base: an 8 or 9 can never appear in octal, and binary only allows 0 and 1. A digit equal to or larger than the base is the sign of a wrong conversion.
A handy shortcut for binary-hex: each hex digit is exactly four binary digits, since 2⁴ = 16. F = 1111, 2 = 0010, so hex 2F is 101111 in binary — group the bits in fours to see it.