How to convert between number bases
Type a number into any box – decimal, hexadecimal, binary, octal or a base of your choice – and all the other boxes update instantly. Prefixes such as 0x, 0b and 0o, spaces and underscores are ignored, and negative numbers work too. There is no size limit: 100-digit numbers are converted exactly.
Number systems explained
- Binary (base 2) uses only 0 and 1. It is how computers store everything.
- Octal (base 8) uses digits 0–7. It appears in Unix file permissions such as
chmod 755. - Decimal (base 10) is the everyday system with digits 0–9.
- Hexadecimal (base 16) uses 0–9 and A–F. One hex digit is exactly 4 bits, so it is a compact way to write bytes, memory addresses and colors like
#FF8800. - Base 36 uses all digits and letters, and is used for short IDs and URL shorteners.
Quick reference
| Decimal | Binary | Hex |
|---|---|---|
| 10 | 1010 | A |
| 15 | 1111 | F |
| 16 | 1 0000 | 10 |
| 100 | 110 0100 | 64 |
| 255 | 1111 1111 | FF |
| 1024 | 100 0000 0000 | 400 |
FAQ
How do I convert hex to decimal by hand?
Multiply each digit by 16 raised to its position, counting from 0 on the right, and add the results. For example, 2F = 2 × 16 + 15 × 1 = 47.
How are negative numbers shown?
With a minus sign, for example −255 is -FF. Computers usually store negative numbers in two’s complement, which depends on the number of bits, so it is not shown here.