Hex Calculator
Hexadecimal calculator: add, subtract, multiply, divide and apply AND, OR, XOR, NOT and shifts to hex numbers, with binary, decimal and octal output.
Choose 8/16/32/64-bit to see two's complement patterns (useful for NOT and negative numbers).
Results
- Arbitrary-precision integers (BigInt). Division truncates toward zero. With a bit width, results are wrapped and shown as two's complement.
What is Hex Calculator?
Does arithmetic and bitwise logic on hexadecimal numbers of any size. The result is shown in hex, binary, decimal and octal, and an optional bit width shows two's-complement values for 8, 16, 32 or 64 bits.
How to use Hex Calculator
- Enter Number A in hex (digits 0–9 and A–F, optional
0xprefix). - Choose an Operation and enter Number B.
- Optionally pick a Bit width to wrap the result, then read all four bases.
Example
FF × 2
1FE (binary 1 1111 1110, decimal 510)
When to use Hex Calculator
Use it for memory addresses, colour arithmetic, register values and protocol fields. For fractional or floating-point hex values this tool is not suitable; it works with integers only.
How Hex Calculator works
Hex strings are parsed into BigInt values (case-insensitive), the chosen operation is applied (integer division truncates toward zero), and the result is printed in base 16, 2, 10 and 8. With a bit width the value is wrapped to that many bits, so −1 in 32 bits is FFFFFFFF, and the signed interpretation is shown too.
Common Use Cases
- Calculating address offsets
- Masking register bits with AND
- Checking 32-bit overflow with a bit width
- Converting a hex result to decimal
FAQs
Are lowercase letters accepted?
Yes, ff and FF are the same. Results are shown in uppercase.
How is division handled?
It is integer division that truncates toward zero; use mod for the remainder.
What does the bit width change?
It wraps the result to 8/16/32/64 bits and pads the hex and binary output, as a fixed-size register would.