Number base converter

Convert between binary, octal, decimal, hexadecimal and any base 2–36 in real time. Supports huge numbers and negatives, with automatic 0x / 0b / 0o prefix detection. Runs fully in your browser.

Input value
Enter a value to convert in real time.
Results
Enter a value and results for each base will be listed here.
More bases (enter any target base from 2 to 36)

The same number, written four ways

BaseNameDigits usedExample
2Binary0 11010
8Octal0 – 712
10Decimal0 – 910
16Hexadecimal0 – 9, A – FA

All four rows represent the same quantity. The base is just how many distinct symbols each position can hold before you carry.

Why programmers use hexadecimal

One hex digit maps exactly onto four binary digits. That means a byte — eight bits — is always exactly two hex characters, with no arithmetic required to convert back and forth. Octal played the same role for 12-bit and 36-bit machines and has largely fallen out of favour, surviving mainly in Unix file permissions such as 755.

Prefixes and the ambiguity problem

Because bases 2 to 16 all reuse the same digit shapes, notation needs disambiguation. Common conventions include 0b for binary, 0o or a leading zero for octal, and 0x for hex. The leading-zero convention has caused real bugs: input like 08 was historically parsed as octal by some languages, producing an error because 8 is not a valid octal digit. Modern specifications removed that behaviour, but data coming from older systems may still carry it.

Converting between bases by hand

  1. To decimal: multiply each digit by the base raised to its position, counting from zero on the right, and add the results.
  2. From decimal: divide by the target base repeatedly, reading the remainders in reverse order.
  3. Between two non-decimal bases: go through decimal, or use binary as a bridge when the bases are powers of two.

Where each base shows up

Related tools

ASCII table Subnet calculator Hash generator

FAQ

How do I convert hex to decimal?
Enter a hexadecimal number (for example FF or 0xFF) in the input box, choose 16 as the source base, and the result area shows the decimal value (255) in real time. You can also paste a string with a 0x prefix — the tool detects it as hexadecimal automatically.
Can it convert very large numbers?
Yes. The tool is built on JavaScript BigInt, so it is not limited by 64-bit floating-point precision. Integers hundreds of digits long convert exactly, with no lost precision at the end.
What are the 0x, 0b and 0o prefixes?
They are common programming-language notations: 0x means hexadecimal, 0b means binary, and 0o means octal. The tool recognizes these prefixes automatically and uses the matching base — no manual selection needed.
Which bases are supported?
Any base from 2 to 36. The common binary, octal, decimal and hexadecimal bases are listed directly, and you can enter any target base under More bases to see the result.