Decimal to Hexadecimal Calculator
Convert between decimal and hexadecimal number systems instantly. This calculator also shows binary and octal representations, plus the programmer-friendly 0x prefix format. Essential for web development, system programming, and digital electronics.
Hexadecimal (base 16) is the most common shorthand for binary data in computing. Each hex digit represents exactly 4 bits, so a byte (8 bits) is always exactly 2 hex digits. That compact mapping is why hex is everywhere in programming.
How the Conversion Works:
To convert decimal to hex, repeatedly divide by 16 and record the remainders. Map remainders 10-15 to A-F.
Example: 255 / 16 = 15 remainder 15. 15 in hex = F. So 255 = FF.
Common Decimal to Hex Values:
| Decimal | Hex | Binary | Usage |
|---|---|---|---|
| 0 | 0 | 0 | Zero |
| 10 | A | 1010 | First hex letter |
| 15 | F | 1111 | Max single hex digit |
| 16 | 10 | 10000 | Two hex digits start |
| 127 | 7F | 1111111 | Max signed byte |
| 255 | FF | 11111111 | Max byte value |
| 256 | 100 | 100000000 | Three hex digits start |
| 65535 | FFFF | 1111111111111111 | Max 2-byte value |
| 16777215 | FFFFFF | ... | Max 3-byte (white in RGB) |
In web development, CSS hex colors like #FF5733 are three hex byte pairs: FF (red = 255), 57 (green = 87), 33 (blue = 51).