Number base converter
Rewrite a number in another base, with binary, octal, decimal and hex shown together.
Result
Result: FF
- Binary (base 2)
- 11111111
- Octal (base 8)
- 377
- Decimal (base 10)
- 255
- Hexadecimal (base 16)
- FF
How it works
In base b each place is worth b times the place to its right. The calculator reads your digits into an exact big integer (and an exact fraction for digits after the point), then writes that value in the new base.
The whole part is converted by repeated division by the new base; the fractional part by repeated multiplication. A fraction that ends in one base may repeat forever in another: 0.1 in decimal is 0.0001100110011… in binary.
Formula
value = Σ dᵢ × bⁱ hex digits: A = 10 … F = 15 base 36 digits: 0–9, A–Z
Worked example
255 in decimal is FF in hexadecimal (15 × 16 + 15), 11111111 in binary and 377 in octal (3 × 64 + 7 × 8 + 7).
Questions people ask
How do I convert binary to decimal by hand?
Multiply each digit by its power of 2 and add: 1011 = 8 + 0 + 2 + 1 = 11.
Why does hexadecimal use letters?
Base 16 needs sixteen digits, so A to F stand for 10 to 15. One hex digit is exactly four binary digits.
Can I convert negative numbers?
Yes, with a minus sign. The result is the signed value, not a two’s complement bit pattern.