Hexadecimal calculator
Type two numbers in hexadecimal (digits 0 to 9 and letters A to F) and pick the operation. The result is exact, even for very large numbers.
Result
119Result in hexadecimal
- In decimal
- 281
- In binary
- 100011001
Inputs
- First hex number
- FF
- Operation
- + (add)
- Second hex number
- 1A
How it is calculated
Each hex digit is a power of 16: FF = 15 × 16 + 15 = 255.
Result
Result in hexadecimal
- In decimal
- 281
- In binary
- 100011001
How it is calculated
- Each hex digit is a power of 16: FF = 15 × 16 + 15 = 255.
- We compute on exact whole numbers, then write the result back in base 16.
- Division: whole quotient (rounded toward zero) and remainder.
Example
FF + 1A = 255 + 26 = 281, that is 119 in hexadecimal.
Good to know
- Only the characters 0-9 and A-F (upper or lower case) are accepted.
- Up to 4,096 digits per number. Binary is only shown up to 128 bits.
When to use it
- Add or subtract memory addresses or offsets written in hexadecimal.
- Check a colour code calculation, such as the gap between #FF and #1A on one channel.
- For bit-level work (AND, OR, XOR, fixed widths), the Binary calculator is the better fit.
Frequently asked questions
Why is hexadecimal used in programming?
One hex digit stands for exactly 4 bits, so a byte is always two digits (00 to FF). Long binary values become short and easy to read.
Does it matter if I type ff or FF?
No. Upper and lower case letters are read the same way, so ff, Ff and FF are all 255.
How does division with a remainder work in hex?
It works as with ordinary numbers. FF ÷ 10 (that is 255 ÷ 16) gives F with remainder F, because 16 × 15 + 15 = 255.