Skip to content
🔢

Number Base Converter

Convert a number between binary, octal, decimal, hexadecimal, and base 36.

Runs in your browser

Updated

In every base

Decimal

-

Bit length

-

Base 256 bytes

-

Set bits

-

Bit view

-

Values are handled as BigInt, so numbers well past the safe integer limit of 9007199254740991 stay exact. Digits above nine are shown as letters, so FF in hex is 255 in decimal. Binary output is grouped into four-bit nibbles for readability, which is not part of the value.

Five bases, arbitrary precision

The input is parsed into a JavaScript BigInt, so long values do not lose digits. Outputs are binary, octal, decimal, hexadecimal and base 36, with copy buttons and a bit-length count. Auto-detection recognises the 0x, 0b and 0o prefixes, treats a string of only zeros and ones as binary, a leading zero followed by digits 0 to 7 as octal, and any letter A to F as hexadecimal.

A worked example

255 converts to 11111111 in binary, 377 in octal, FF in hexadecimal and 73 in base 36. Entering 0xFF is detected as hexadecimal and produces the same set. The page also shows the byte list in base 256 and a view grouped into four-bit nibbles.

Signed mode

The signed checkbox interprets the value as two's complement. That works cleanly for 8-bit binary and 32-bit hex patterns, but it is not width-aware: the tool does not ask how many bits the value is meant to occupy, so a 16-bit negative number cannot be expressed exactly. Treat signed output as a convenience for quick inspection.

Where it stops

  • Auto-detection can misread a decimal with a leading zero as octal.
  • Only bases 2, 8, 10, 16 and 36 are offered.
  • Signed handling only special-cases binary and hexadecimal.
  • No fractions or negative fractional values.

Questions people ask

Why is FF equal to 255?

Two hex digits are two powers of sixteen: 15 times 16 plus 15. Each hex digit is four bits, so FF is 11111111.

How do I convert text to binary?

Use the binary to text converter for character codes. For Roman numerals see the Roman numeral converter, and for readable digits the number to words converter.