Hex Calculator
Enter two hexadecimal numbers and choose an operation. See the answer in hex, decimal, binary and octal.
- + − × ÷ mod
- AND · OR · XOR · NOT
- Bit shifts
- Results in 4 bases
What is a hex calculator?
A hex calculator does arithmetic and bitwise logic on base-16 numbers. Programmers use it to add offsets to memory addresses, combine bit masks, compute sizes and check checksums without converting to decimal first. This calculator accepts hex with or without a 0x prefix, supports + − × ÷ and remainder, AND, OR, XOR, NOT and shifts, and shows every result in hex, decimal, binary and octal.
How to use the hex calculator
- Enter the first hex number in A and the second in B. 0x prefixes are optional.
- Choose an operation.
- Read the result in hex, decimal, binary and octal.
- Copy the format you need.
Bitwise operations at a glance
- AND: 1 only where both bits are 1. 1100 AND 1010 = 1000.
- OR: 1 where either bit is 1. 1100 OR 1010 = 1110.
- XOR: 1 where the bits differ. 1100 XOR 1010 = 0110.
- NOT flips every bit within the chosen width. Shift left (<<) by n multiplies by 2ⁿ; shift right (>>) divides by 2ⁿ, rounding down.
Why use this hex calculator
- Every operation in one placeArithmetic, bitwise logic and shifts, without switching tools.
- Results in every baseSee the answer in binary, octal, decimal and hex at once.
- No overflowArbitrary-precision integers, so large results are exact.
- Private by designEverything is calculated in your browser. Nothing you type is sent to a server or saved.
Common uses
- Memory addresses. Add an offset: 0x1000 + 0x2F4 = 0x12F4.
- Masks and flags. Combine 0xF0 | 0x0F = 0xFF.
- Sizes and ranges. Subtract start from end addresses.
- Colours. Blend or mask colour channels.
Related converters: number base converter, hex to decimal, decimal to hex, binary to decimal, decimal to binary, hex to binary, binary to hex, binary calculator. Browse all encoding tools.
Example: hex addition
FF + 1A = 119 (hex) = 255 + 26 = 281 (decimal)
What to expect from the result
Integers only; division rounds toward zero and shows the remainder. NOT uses the bit width you choose (8–64 bits). Negative results are shown with a minus sign rather than as two’s complement; use the number base converter to see the bit pattern.
Hex Calculator questions
How do you add hex numbers?
Add column by column from the right. If a column reaches 16 or more, write the value minus 16 and carry 1. F + 1 = 10 (hex).
What is FF + 1 in hex?
100 in hex, which is 256 in decimal.
How do I subtract hex numbers?
Enter both values and choose −. Borrowing works in units of 16; the calculator handles it for you.
Can I use 0x prefixes?
Yes. 0xFF and FF are read the same way.
Does it do bitwise operations?
Yes: AND, OR, XOR, NOT (with a bit width) and left and right shifts.