Number base converter
Type a number in any base and see it in binary, octal, decimal, hex and base 36. Exact, even for huge values.
Why developers need this
Binary shows bit flags and masks, hexadecimal shows colors, memory addresses and hashes, octal shows Unix permissions, and decimal is what people read. Switching between them by hand is a classic source of off-by-one mistakes. Values are processed as exact integers, never floating point.
Frequently asked questions
How do I convert binary to decimal?
Each binary digit is a power of two, from the right: 1, 2, 4, 8 and so on. Add the powers where there is a 1. For example 1010 = 8 + 2 = 10.
Does it handle very large numbers?
Yes. It uses arbitrary-precision integers, so numbers bigger than 2^53 (where JavaScript's normal numbers lose accuracy) convert exactly.
What do 0x, 0b and 0o prefixes mean?
They mark hexadecimal, binary and octal literals in code, as in 0xFF. The converter accepts and ignores them.
How do I do it in Java?
Integer.parseInt("ff", 16) to parse, Integer.toBinaryString(255) or Long.toHexString(255) to format. For huge values use new BigInteger(s, radix).