Hexadecimal Calculator
Calculate with hexadecimal numbers and convert between hexadecimal and decimal.
Hexadecimal calculation – Addition, Subtraction, Multiplication or Division
Result
Hexadecimal value:
—
Decimal value:
—
Convert Hexadecimal to Decimal
Convert Decimal to Hexadecimal
The Hexadecimal System
The hexadecimal system (or hex) is a base-16 number system with 16 different symbols: the digits 0 to 9 and the letters A to F. Each hexadecimal digit corresponds to 4 bits (a nibble) in binary, making it particularly well-suited for computing.
Conversion Table
| Hexadecimal | Binary | Decimal |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 2 | 0010 | 2 |
| 3 | 0011 | 3 |
| 4 | 0100 | 4 |
| 5 | 0101 | 5 |
| 6 | 0110 | 6 |
| 7 | 0111 | 7 |
| 8 | 1000 | 8 |
| 9 | 1001 | 9 |
| A | 1010 | 10 |
| B | 1011 | 11 |
| C | 1100 | 12 |
| D | 1101 | 13 |
| E | 1110 | 14 |
| F | 1111 | 15 |
Convert Decimal to Hexadecimal
To convert a decimal number to hexadecimal, divide the number repeatedly by 16 and note the remainders. The remainders read from bottom to top give the hexadecimal number. Example:
255 in Hex:
255 ÷ 16 = 15 R.15 (F)
15 ÷ 16 = 0 R.15 (F)
Result: FF
Convert Hexadecimal to Decimal
Multiply each digit by the correct power of 16 (from the right) and add. E.g.:
1A2 in Decimal:
1×16² + 10×16¹ + 2×16⁰
= 256 + 160 + 2
= 418
Where hex is used
Hex fits computing well: one digit = 4 bits, so binary is easy to read and write. Typical uses:
- RGB color codes (e.g. #FF0000 for red)
- Memory addresses
- Program debugging
- Unique identifiers (UUID)
Hex in short
Base 16: digits 0–9 then A–F (A=10 … F=15). 0x is often used for addresses, colours and codes.
- Decimal → Hex: repeated division by 16, read remainders from bottom to top.
- Hex → Decimal: sum of digits × 16ⁿ according to position.
- Binary relation: 1 hex digit = 4 bits, so 2 hex digits = 1 byte.
255₁₀ → FF₁₆ (remainders 15=F).
1A2₁₆ → 1×256 + 10×16 + 2×1 = 418.
0x1F → 31 in decimal, 11111 in binary.
Tip: For verification, convert back to decimal and compare. Errors often occur due to incorrect position of powers of 16.
For division-by-16, 0x notation or binary links, the main solver can walk you through it.