How do you convert between number bases?
A number base (radix) defines how many digits are used to write numbers: binary uses 2, octal 8, decimal 10 and hexadecimal 16. This number base converter turns an integer written in any base from 2 to 36 into all the others as you type, for example decimal 255 is binary 11111111, octal 377 and hexadecimal FF. It uses BigInt, so numbers of any size are converted exactly, and everything runs in your browser.
How to convert a number to another base
- 1
Type the number in the field of its base, for example hexadecimal FF or binary 1010.
- 2
Read the same value in binary, octal, decimal and hexadecimal below it, which update instantly.
- 3
Enter a custom base from 2 to 36 to see a fifth representation, such as base 36 or base 32.
- 4
Turn on digit grouping to make long binary and hex values easier to read, then copy the result.
Key features
Any base from 2 to 36
Besides binary, octal, decimal and hex, choose any radix up to 36, which uses the digits 0–9 and letters a–z.
Arbitrary precision
BigInt arithmetic converts 64-bit, 128-bit and larger integers without rounding errors that floating-point numbers would cause.
Edit any field
Type in any row and the others follow. Prefixes such as 0x, 0b and 0o, signs and spaces are accepted.
Grouped output
Binary and hex values can be shown in groups of four digits, and decimal in groups of three, for easier reading.
Frequently asked questions
How do I convert binary to decimal?
Multiply each binary digit by the power of 2 for its position and add the results. For example 1011 = 8 + 0 + 2 + 1 = 11. The converter does this instantly: type 1011 in the binary field.
How do I convert decimal to hexadecimal?
Divide the number by 16 repeatedly and read the remainders from last to first, using A–F for 10–15. Decimal 255 gives FF.
Why is hexadecimal used in computing?
One hexadecimal digit represents exactly four bits, so a byte is always two hex digits. This makes binary data compact and easy to read, for example in colors (#FF8800) and memory addresses.
Does this converter support negative numbers and fractions?
Negative integers are supported with a minus sign and shown as signed values, not as two’s complement. Fractions are not supported; the tool converts whole numbers only.
What is the largest number I can convert?
There is no fixed limit. BigInt supports integers of arbitrary length, limited only by your device’s memory.