Number Converter

Convert whole numbers between bases 2 to 36 (binary, decimal, hex, and more)

How to convert a number to another base

The converter works with whole numbers of any length, in every base from 2 to 36. Binary, octal, decimal and hexadecimal have their own names in the list; the others appear as base-3, base-5 and so on. The arithmetic is done with arbitrary-precision integers, so a 20-digit ID or a 64-bit mask comes out exactly, digit for digit.

What you can type

Fractions, exponents such as 1e3, a plus sign and spaces inside the number are not accepted. Instead of guessing, the converter names the first character it cannot read and its position, for example: Invalid character "2" at position 3: not a base-2 digit (base-2 digits are 0-1).

Worked examples

The same values in common bases

Base 2Base 8Base 10Base 16Base 36
1117777
10101210AA
10101052422A16
1100100144100642S
11111111377255FF73
10000000040025610074
1111101000175010003E8RS
11111111111177774095FFF35R
111111111111111117777765535FFFF1EKF

One hexadecimal digit stands for exactly four binary digits and one octal digit for exactly three. That is why hexadecimal is used for bytes, memory addresses and colours (FF8800 is 16746496), and octal for Unix file permissions, where 755 is 111101101 in binary: three groups of three bits for owner, group and others.

What the result looks like

Digits above 9 are written in upper case. The result has no prefix, no digit grouping and no leading zeros: 007 in decimal becomes 111 in binary, and 0o644 in octal becomes 110100100. If you need a fixed width, such as 8 or 32 bits, pad the result with zeros on the left yourself.

Negative numbers are not two's complement

A negative number keeps its minus sign: -42 in decimal is -101010 in binary and -2A in hexadecimal, and -1 is simply -1. Computers usually store negative integers in two's complement, where the bit pattern depends on the width. The converter does not choose a width for you, but you can get the pattern by adding 2 to the power of the width first: for an 8-bit value, −42 + 256 = 214, and 214 in binary is 11010110. For a 32-bit value, −1 + 4294967296 = 4294967295, which is FFFFFFFF in hexadecimal.

Common pitfalls

Frequently asked questions

Why does base 36 stop at Z?

Ten digits plus 26 letters give 36 symbols, so 36 is the largest base that can be written with ordinary alphanumeric characters. In base 36, ZZ is 1295.

Can I convert fractions such as 0.1?

No. The converter handles whole numbers only. Many fractions have no exact representation in another base: 0.1 in decimal repeats forever in binary.

Is there a size limit?

There is no fixed limit. Numbers with thousands of digits convert exactly; very long inputs only take longer because the work happens in your browser.

Why is my result shorter than the input?

Leading zeros carry no value and are not written, and higher bases need fewer digits: 65535 is FFFF in hexadecimal.