Number base converter
Convert integers between binary, octal, decimal, and hexadecimal while preserving precision for large values.
How to use
- Enter an integer and choose its Input base: binary, octal, decimal, or hexadecimal. You may use 0b, 0o, or 0x in the matching base.
- Select the Output base and click Convert base to see the chosen representation.
- Use Copy result and state the base when sharing the number, because output has no identifying prefix.
How it works
Accepts positive or negative integers with up to 4,096 digits, with optional 0b, 0o, and 0x prefixes in the matching base. Fractions, scientific notation, and separators are not accepted; output has no prefix.
An example
Decimal 255 equals binary 11111111, octal 377, and hexadecimal FF.
Common questions
Why can’t I use the digit 8 in octal?
Octal uses only digits 0 through 7. Binary accepts 0 and 1; hexadecimal also uses letters A through F.
Are negative numbers converted to two’s complement?
No. The tool keeps the minus sign and converts the magnitude. A two’s-complement representation requires choosing a bit width.