Number Base Converter
Convert integers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Also displays a 16-bit binary representation for values under 65536.
Number Base Reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 4 | 100 | 4 | 4 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
| 65535 | 1111111111111111 | 177777 | FFFF |
Code prefixes: binary = 0b, octal = 0o, hex = 0x. Powers of 2 are key: 2⁸=256, 2¹⁰=1024 (1 KB), 2¹⁶=65536.
How to use
Selecting the input base
Click the base of your input number before typing. For example, if you have a hex number like 1A3F, click Hexadecimal first.
Hexadecimal input
You can type digits 0–9 and letters A–F (case insensitive). Letters are automatically uppercased in the output.
16-bit view
For values 0–65535, a bit-level breakdown is shown with the bit position number above each bit. Active bits (1) are highlighted.
Formula
Binary: base 2 (0,1)
Octal: base 8 (0–7)
Decimal: base 10 (0–9)
Hex: base 16 (0–9, A–F)
Tips
- •In programming, binary is prefixed with 0b, octal with 0o, and hex with 0x.
- •255 in decimal = 0xFF in hex = 11111111 in binary (all 8 bits set).
- •Hexadecimal is widely used in web colours: #FF5733 = R:255 G:87 B:51.