Number base converter

Type a number and see it in binary, octal, decimal, hexadecimal and any base from 2 to 36 at once. Numbers of any size, fractions and signed two's complement values are supported, and every bit can be flipped with a click.

Free and private. Everything runs in your browser, nothing is uploaded.

How it works

  1. Type a numberEnter the number and choose its base. Prefixes like 0x, 0b and 0o are recognized.
  2. Read every baseBinary, octal, decimal and hex appear at once, plus one base of your choice.
  3. Copy or flip bitsCopy any result, or click bits in the bit view to change the number.

How number bases work

A base says how many different digits a number system uses. Decimal uses ten (0 to 9), binary uses two (0 and 1), octal uses eight and hexadecimal uses sixteen, with the letters A to F for the values 10 to 15. Each position is worth the base times more than the position to its right, so binary 1011 is 8 + 0 + 2 + 1 = 11 in decimal.

Computers store everything in binary, and programmers use hex because one hex digit stands for exactly four bits. That is why colors, memory addresses, byte values and file signatures are usually written in hex. Base 36 uses all digits and letters and is used for short IDs.

Exact results for very large numbers

Many converters lose precision after about 16 decimal digits, because they use the same floating point numbers as a calculator. This one calculates with whole numbers of any length, so a 128 bit value or a 40 digit decimal comes out exactly right. Fractions are converted digit by digit: when the digits repeat forever, as 0.1 does in binary, the repeating part is shown in brackets, and long results are cut after the number of digits you choose.

Signed numbers and two's complement

Processors store negative whole numbers in two's complement: in 8 bits, -1 is 11111111 and -128 is 10000000. Turn on Signed and choose a bit width to see the pattern of a negative decimal number, or to read a binary or hex pattern as a signed value. The tool warns when a value does not fit in the chosen width.

Frequently asked questions

How do I convert decimal to binary by hand?

Divide the number by 2 again and again and write down the remainders, then read them from the last to the first. For 13: 13, 6, 3, 1 give remainders 1, 0, 1, 1, so 13 is 1101.

Why does 0.1 never end in binary?

Because 1/10 cannot be written as a sum of powers of two, just as 1/3 never ends in decimal. The repeating part 0011 is shown in brackets.

What is the largest number I can convert?

Numbers with up to 20,000 digits are accepted. The results are exact, there is no rounding.

Is anything sent to a server?

No. All calculations happen in your browser.