Number Base Converter

Enter a number, choose its base, and get it in binary, octal, decimal and hexadecimal at once.

Base of the number you enter
Whole numbers only (fractions are not supported). You can use a minus sign, the prefixes 0b, 0o and 0x, and spaces or "_" as separators (and "," in decimal).
Letters in hexadecimal
Digit grouping (display only; copied values have no grouping)
Binary

—

Octal

—

Decimal

—

Hexadecimal

—

—

How the bases work

The conversion uses BigInt, which handles integers of any size without rounding errors, so even very large integers are converted exactly.

Examples

Decimal Binary Octal Hexadecimal
10 1010 12 A
255 1111 1111 377 FF
256 1 0000 0000 400 100
500 1 1111 0100 764 1F4
65,535 1111 1111 1111 1111 177777 FFFF

Input rules

Negative numbers

A negative number is converted as a minus sign plus its absolute value (-255 is -FF in hexadecimal and -11111111 in binary). Computers often store negative numbers in a different form called "two's complement", but this tool does not support two's complement. -0 becomes 0.

Notes

Frequently asked questions

Do I need to type "0x" for hexadecimal?

No. "0x" only marks a number as hexadecimal, so you can leave it out. If you type it, it is removed automatically.

How large a number can I convert?

Any whole number below 2 to the power 256, which in decimal is a number smaller than about 1.16 × 10 to the power 77.

Can I convert fractions, or get the two's complement of a negative number?

No. This tool converts whole numbers only; fractions and two's complement are not supported.