Number bases

Binary, octal, decimal, hexadecimal and more

No database: AIMRAN doesn't store your files, text or results

What is Number bases?

Computers work in binary (zeros and ones) and programmers often use hexadecimal or octal. This tool converts a number between all those bases at once: type in any field and the others update.

You can also use a custom base from 2 to 36 and see useful details such as how many bits the number needs or its two's complement representation.

How to use it

  1. Type the number into any field: binary, octal, decimal or hexadecimal.
  2. If needed, choose a custom base from 2 to 36.
  3. Turn on “Group digits” or “Uppercase letters” for easier reading.
  4. Under “Details”, check the bits needed and the 8, 16, 32 or 64-bit two's complement.
  5. Copy the value you need.

Advantages

Technical details

Values are handled as BigInt, so there's no 2^53 limit and large integers convert without loss. Input accepts a sign, spaces and underscores as separators, and the 0b, 0o and 0x prefixes for binary, octal and hexadecimal; digits above 9 are represented with letters a to z (base 36). The number of bits needed is the length of the binary representation of the absolute value. Two's complement is calculated as 2^n + value for negatives at 8, 16, 32 or 64-bit widths, indicating when the number doesn't fit. Grouping splits binary into groups of 4, hexadecimal into groups of 2 and decimal into groups of 3.

Frequently asked questions

How do you convert decimal to binary?

Divide the number by 2 repeatedly and read the remainders from bottom to top. For example, 13 is 1101. The tool does it instantly.

How do I convert hexadecimal to decimal?

Each digit is multiplied by 16 raised to its position. FF = 15 × 16 + 15 = 255. Type the value into the hexadecimal field and you'll see the decimal.

What is two's complement?

The usual way of representing negative numbers in binary: invert the bits and add 1. In 8 bits, −1 is 11111111.

Is there a size limit on numbers?

No. Arbitrary-precision integers are used, so you can convert numbers with hundreds of digits.

Can I use the 0x or 0b prefixes?

Yes. 0x for hexadecimal, 0b for binary and 0o for octal are accepted, as well as underscores as separators.

More Developers tools