Convert between binary, hexadecimal, decimal, and octal number systems.
| Decimal | Hex | Binary | Octal |
|---|---|---|---|
| 8 | 0x08 | 0000 1000 | 10 |
| 16 | 0x10 | 0001 0000 | 20 |
| 32 | 0x20 | 0010 0000 | 40 |
| 64 | 0x40 | 0100 0000 | 100 |
| 128 | 0x80 | 1000 0000 | 200 |
| 255 | 0xFF | 1111 1111 | 377 |
| 256 | 0x100 | 1 0000 0000 | 400 |
| 65535 | 0xFFFF | 1111 1111 1111 1111 | 177777 |
Uses digits 0-1. The native language of digital circuits and computers. Each digit represents a power of 2.
Uses digits 0-7. Less common today but still used in some Unix/Linux file permissions.
Uses digits 0-9. The standard human-readable number system we use daily.
Uses 0-9 and A-F. Compact representation of binary data. 1 hex digit = 4 binary bits.
Multiply each binary digit by its position value (powers of 2) and sum them. For example: 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11
Hex is compact (1 hex digit = 4 bits) and easy to convert to/from binary. It's widely used in programming, memory addressing, and color codes.
0x indicates hexadecimal, 0b indicates binary, and 0o indicates octal. These prefixes help distinguish the number base in code.