Number Base Converter

Convert numbers between binary, octal, decimal and hexadecimal.

How to use the number base converter

  1. Type a number into any field: binary, octal, decimal, hexadecimal or the custom base.
  2. All the other fields update as you type. Prefixes (0b, 0o, 0x), a leading minus sign and spaces or underscores between digits are accepted.
  3. Set the custom Base to anything from 2 to 36; digits above 9 use the letters a to z.
  4. Tick Group digits to space out long results, and use Copy next to a field to copy it.

Example

Typing 255 into the decimal field gives 11111111 in binary, 377 in octal,ff in hexadecimal and 73 in base 36. Large values convert exactly:18446744073709551616 (264) is 10000000000000000 in hex, and-0x1F in the hex field shows -31 in decimal.

Frequently asked questions

Is there a size limit?

No practical one. The converter uses JavaScript BigInt, so numbers with hundreds of digits convert without the rounding errors you get past 253 with ordinary numbers, and well beyond 64-bit integers.

How are negative numbers shown?

With a minus sign in every base, for example -1010 in binary. The converter does not produce two's complement bit patterns, because those depend on a fixed width such as 8, 32 or 64 bits.

Does it handle fractions?

No, only whole numbers. A decimal point is reported as an invalid digit. Everything runs in your browser and the numbers you enter are never sent anywhere.