Number base converter
A number base calculator that converts between any two number systems: binary, octal, decimal, hex, or any base from 2 to 36, with the working. It also works as a hex converter and a base 36 converter.
Prefixes 0b, 0o, 0x and spaces or underscores between digits are fine. A point starts the fraction.
How to convert between any two bases
Go through decimal. First turn the number into decimal by multiplying each digit by the base raised to its position and adding. Then divide by the new base again and again, and read the remainders from the bottom up.
When both bases are powers of 2 (binary, base 4, octal, hex, base 32) there’s a shortcut: go through binary instead, grouping bits by 2, 3, 4 or 5.
| Digit | Place value | Digit × place value |
|---|---|---|
| 2 | 33 = 27 | 54 |
| 1 | 32 = 9 | 9 |
| 0 | 31 = 3 | 0 |
| 1 | 30 = 1 | 1 |
54 + 9 + 0 + 1 = 64, so 21013 = 6410.
Number systems and their bases
| Base | Name | Digits | 255 in this base |
|---|---|---|---|
| 2 | Binary | 0 1 | 11111111 |
| 3 | Ternary | 0–2 | 100110 |
| 8 | Octal | 0–7 | 377 |
| 10 | Decimal | 0–9 | 255 |
| 12 | Duodecimal | 0–9, A, B | 193 |
| 16 | Hexadecimal | 0–9, A–F | FF |
| 36 | Base 36 | 0–9, A–Z | 73 |
How it’s calculated
Conversions use exact whole-number arithmetic (JavaScript BigInt), so long numbers keep every digit. Fractions are kept as exact ratios; when the digits repeat, the repeating block is found and marked instead of rounded.
Questions
Is this a number base calculator too?
Yes. It works as a base calculator for conversions: base 10 to base 2, base 12, base 36 or any other pair from 2 to 36. For arithmetic in binary or hex, use the binary calculator or the hex calculator.
Is a number system converter the same as a base converter?
Yes. A number system is named by its base: binary is base 2, octal base 8, decimal base 10 and hexadecimal base 16. This converter handles those four and every other base up to 36.
Why does the converter stop at base 36?
Bases above 10 use letters for the extra digits, and there are 10 digits plus 26 letters, which makes 36.
Are fractions converted exactly?
Yes. The converter keeps the fraction as an exact ratio, finds where the digits start repeating and marks that block with a line over it.
Does it convert negative numbers?
Yes, with a minus sign. For the two’s complement bit pattern of a negative number, tick “Read as signed”.