How number bases work
A number base says how many different digits are used before you "carry" to the next place. Everyday numbers are decimal (base 10, digits 0–9). Computers work in binary (base 2, just 0 and 1). Programmers often use hexadecimal (base 16, digits 0–9 then A–F) because each hex digit stands for exactly four binary digits, which makes long binary numbers easier to read.
Each place is worth the base raised to a power. For example, binary 1011 is 1×8 + 0×4 + 1×2 + 1×1 = 11 in decimal, and hex 7E5 is 7×256 + 14×16 + 5 = 2021.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 5 | 101 | 5 | 5 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 1 0000 | 20 | 10 |
| 100 | 110 0100 | 144 | 64 |
| 255 | 1111 1111 | 377 | FF |
| 1,024 | 100 0000 0000 | 2000 | 400 |
Tips
- You can type prefixes such as
0x,0band0o, and spaces or underscores between digits. They're ignored. - Very large whole numbers are supported, with no rounding. Negative numbers work too: type a minus sign first.
- "Any base" supports every base from 2 to 36, using the letters A–Z as digits above 9.
Whole numbers only. Fractions aren't converted.