Kadben

Number base converter

Type a whole number in any base from 2 to 36. The page shows it in binary, octal, decimal, hexadecimal and one more base of your choice, exactly at any length, with its bit patterns in two’s complement.

Runs in your browser. Nothing is uploaded.

Number base converter

Spaces and underscores between digits are ignored; the letters a–z are the digits 10 to 35.

Two’s complement

BitsPattern (hex)Pattern (binary)As unsignedAs signed

How to use it

  1. Type or paste a number, for example 255, -0x1F or 1111 0000.
  2. Choose the base it is written in, or “Automatic” to go by its prefix.
  3. Read it in binary, octal, decimal, hexadecimal and the extra base you choose; copy any line.
  4. Under “Two’s complement”, see its bit pattern in 8, 16, 32 and 64 bits.

Rules and limits

How numbers are read and written

Tested limits

Questions and answers

Why is 0xFF −1 in the two’s complement table?

A byte carries no sign of its own. Read as signed, the top bit counts as −128, so 1111 1111 means −128 + 127 = −1; read as unsigned it is 255. Both readings are shown, because the bits alone do not say which one a program meant.

Can it convert fractions such as 0.1?

No. A fraction often has no finite form in another base (0.1 in binary repeats forever), so a result would have to be cut short, and the page gives only exact results.

Why does “Automatic” refuse 010?

Older C and JavaScript code read a leading zero as octal, so 010 could mean 8 or 10. Python refuses it to avoid the mix-up, and so does this page; choose base 8 or 10 to say which you mean.

Is my number sent anywhere?

No. It is converted in your browser and the page sends nothing. The typed number is kept only in this tab, like other tools’ options.

Related tools