How to use it
- Choose the base of the number you have: binary, octal, decimal, hexadecimal or another base from 2 to 36.
- Type or paste the number. Prefixes such as 0x and separators such as _ are fine.
- Read the number in every base at once and copy the one you need.
- Use the last row to convert to any other base, for example base 36 for short IDs.
How it works
A positional number system writes a value as digits multiplied by powers of the base. In binary (base 2) each digit is a bit; in octal (base 8) each digit stands for 3 bits; in hexadecimal (base 16) each digit stands for 4 bits, using the letters A–F for 10 to 15. Bases above 16 continue through the alphabet, up to base 36, which uses all digits 0–9 and letters A–Z.
The converter uses JavaScript BigInt arithmetic, so numbers of any length are converted exactly. Ordinary floating-point numbers lose precision above 9,007,199,254,740,991 (2^53 − 1), which is why some converters give wrong results for 64-bit values.
Input is checked digit by digit against the selected base. The first invalid character is reported with its position, for example a 2 in a binary number or a G in a hexadecimal one. Letters are case-insensitive. Spaces and underscores are ignored, so you can paste values such as 1111_0000 or DE AD BE EF. The prefixes 0b (binary), 0o (octal) and 0x (hexadecimal) are accepted; if the input base is set to decimal and the number starts with one of these prefixes, the prefix decides the base.
Negative numbers are converted as a minus sign followed by the magnitude (−255 is −FF in hexadecimal). The tool does not show two's complement representations, which depend on a fixed bit width such as 8, 32 or 64 bits. Fractions are not supported: only whole numbers are converted.
Examples
Reading a hexadecimal color or byte value
0xFF is 255 in decimal and 1111 1111 in binary: the maximum value of one byte, as in the color #FF0000, where FF means full red.
Unix file permissions
The octal permission 755 is 111 101 101 in binary: read, write and execute (7) for the owner, and read and execute (5) for the group and others. In decimal it is 493.
Large 64-bit values
The largest unsigned 64-bit integer, FFFF FFFF FFFF FFFF in hexadecimal, is 18446744073709551615 in decimal. It is converted exactly, digit for digit, without rounding.
Frequently asked questions
How do I convert binary to decimal by hand?
Multiply each bit by its power of two, counting from 0 on the right, and add the results. For 1011: 1×8 + 0×4 + 1×2 + 1×1 = 11.
Why are binary and hexadecimal grouped in fours?
One hexadecimal digit corresponds to exactly four bits, so grouping binary in fours lines it up with the hex digits: 1101 1110 is DE. This makes it easy to convert between the two by eye.
Is there a maximum number size?
No fixed maximum. Because the tool uses BigInt, numbers with hundreds or thousands of digits are converted exactly. Extremely long inputs may take a moment on slower devices.
Can I convert negative numbers or fractions?
Negative whole numbers are supported and keep their minus sign. Fractions and decimal points are not supported; the decimal point is reported as an invalid character.
What is base 36 used for?
Base 36 uses 0–9 and A–Z, the most compact case-insensitive alphanumeric form. It is used for short IDs and URL shorteners: for example, 1,000,000 in base 36 is LFLS.
Privacy
Conversions are calculated in your browser. The numbers you enter are not uploaded, stored or included in analytics.