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.
| Base | Name | Digits used | Example |
|---|---|---|---|
| 2 | Binary | 0 1 | 1010 |
| 8 | Octal | 0 – 7 | 12 |
| 10 | Decimal | 0 – 9 | 10 |
| 16 | Hexadecimal | 0 – 9, A – F | A |
All four rows represent the same quantity. The base is just how many distinct symbols each position can hold before you carry.
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.
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.