Hex Calculator
Perform hexadecimal arithmetic and convert between hex, decimal, binary, and octal number systems.
Hexadecimal Operations
Calculation Results
0
base 16
0
base 10
0
base 2
0
base 8
💡 Hex System: Hexadecimal uses 16 symbols: 0-9 and A-F. Each hex digit represents 4 binary bits, making it ideal for representing binary data compactly.
What is Hexadecimal?
Hexadecimal (base-16) is a number system that uses 16 symbols: 0-9 and A-F. It's widely used in computing because it provides a human-friendly representation of binary-coded values. Each hex digit represents exactly 4 binary bits (a nibble).
Hexadecimal Digits
| Hex | Decimal | Binary | Octal |
|---|---|---|---|
| 0 | 0 | 0000 | 0 |
| 1 | 1 | 0001 | 1 |
| 2 | 2 | 0010 | 2 |
| 3 | 3 | 0011 | 3 |
| 4 | 4 | 0100 | 4 |
| 5 | 5 | 0101 | 5 |
| 6 | 6 | 0110 | 6 |
| 7 | 7 | 0111 | 7 |
| 8 | 8 | 1000 | 10 |
| 9 | 9 | 1001 | 11 |
| A | 10 | 1010 | 12 |
| B | 11 | 1011 | 13 |
| C | 12 | 1100 | 14 |
| D | 13 | 1101 | 15 |
| E | 14 | 1110 | 16 |
| F | 15 | 1111 | 17 |
Hex Arithmetic Operations
Hex Addition
Example: 1A + 2B = 45
Step 1: A (10) + B (11) = 21 decimal = 15 hex
Write 5, carry 1
Step 2: 1 + 2 + 1 (carry) = 4
Result: 45
Step 1: A (10) + B (11) = 21 decimal = 15 hex
Write 5, carry 1
Step 2: 1 + 2 + 1 (carry) = 4
Result: 45
Hex Subtraction
Example: 2B - 1A = 11
Step 1: B (11) - A (10) = 1
Step 2: 2 - 1 = 1
Result: 11
Step 1: B (11) - A (10) = 1
Step 2: 2 - 1 = 1
Result: 11
Why Hexadecimal Matters
- Memory Addresses: Computer memory addresses are typically shown in hex.
- Color Codes: Web colors use hex (e.g., #FF5733 = orange).
- MAC Addresses: Network device identifiers use hex.
- Character Encoding: Unicode and ASCII use hex codes.
- Debugging: Programmers use hex to read raw memory dumps.
Hex to Decimal Conversion
To convert hex to decimal, multiply each digit by 16 raised to the power of its position (from right, starting at 0):
1A (hex) = (1 × 16¹) + (A × 16⁰)
= (1 × 16) + (10 × 1)
= 16 + 10 = 26 (decimal)
= (1 × 16) + (10 × 1)
= 16 + 10 = 26 (decimal)
References
- Khan Academy. "Hexadecimal Numbers." 2026.
- GeeksforGeeks. "Hexadecimal Arithmetic." 2026.