Number Base Converter (Binary, Octal, Decimal, Hex)
Free online number base converter for binary, octal, decimal, and hexadecimal. Supports 0b/0o/0x prefixes and arbitrary-precision BigInt locally.
Supports arbitrary-length integers using BigInt.
How to use
Enter a non-negative integer: write decimals directly, and use the 0b, 0o, and 0x prefixes for binary, octal, and hexadecimal respectively. Then click "Convert" to get the result in all four bases at once.
Big integers are handled with BigInt, so values are not limited by the safe-integer range of ordinary JavaScript numbers; the practical length is still bounded by browser resources.
Common conversion scenarios
- Binary to decimal / decimal to binary: handy when working with bitwise operations and masks.
- Hexadecimal to binary: one hex digit corresponds to four binary bits, e.g. 0xF = 1111.
- Hexadecimal to decimal: common when reading color values, memory addresses, and protocol fields.
- Octal to decimal: used for some file permissions and legacy protocol representations.
Prefix notation: 0b1111 is binary, 0o17 is octal, and 0xff is hexadecimal; input without a prefix is parsed as decimal.
Frequently Asked Questions
Does it support base prefixes like 0x, 0b, and 0o?
Yes. Input like 0xff is parsed as hexadecimal, 0b1111 as binary, and 0o17 as octal; input without a prefix is treated as the currently selected base or as decimal.
Can very large integer conversions overflow in precision?
No. The tool uses JavaScript BigInt under the hood to handle non-negative integers, so it is not limited by the 53-bit safe integer cap. Negative numbers and decimals are not currently supported.
Do leading zeros affect the conversion result?
They do not affect the numeric value. For example, binary 000101 and 101 both convert to decimal 5.