Hexadecimal Number System
Hexadecimal (base-16) is a compact way to represent binary data. Each hex digit maps to exactly 4 binary bits, making conversions between hex and binary straightforward. One byte (8 bits) is always two hex digits.
Hex Digits
| Hex | Decimal | Binary |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
Hex Arithmetic
Hex arithmetic works exactly like decimal arithmetic but in base 16. You can add, subtract, multiply, and divide hexadecimal numbers. The calculator converts to decimal internally, performs the operation, and converts back.
Examples
- 3F7 + A2C = E23 (1015 + 2604 = 3619)
- FF × 2 = 1FE (255 × 2 = 510)
- 100 − 1 = FF (256 − 1 = 255)
Common Hex Values
| Hex | Decimal | Significance |
|---|---|---|
| FF | 255 | Max unsigned byte |
| FFFF | 65,535 | Max unsigned 16-bit |
| FFFFFFFF | 4,294,967,295 | Max unsigned 32-bit |
| 7F | 127 | Max signed byte |
| 80 | 128 | High bit set (byte) |
| DEADBEEF | 3,735,928,559 | Common debug marker |
Hex in Web Development
CSS color codes use hexadecimal: #RRGGBB where each pair is 00-FF (0-255). For example, #FF0000 is pure red (R=255, G=0, B=0), and #808080 is medium gray (128, 128, 128).