Last updated ·Published ·By the WiserWork team

Hex Number Calculator

AND, OR, XOR, add, subtract and multiply hexadecimal numbers instantly

Hex0x49
Decimal73
Binary1001001
Copied to clipboard!

Two hex numbers, one operator, three simultaneous answers — this calculator runs AND, OR, XOR, addition, subtraction and multiplication on hexadecimal values and shows the result in hex, decimal and binary at once.

What is the Hex Number Calculator?

The Hex Number Calculator takes two hexadecimal values and an operator you choose from a dropdown — bitwise AND, OR and XOR, plus arithmetic addition, subtraction and multiplication — and computes the result live as you type. Because the math runs on arbitrary-precision integers rather than 32-bit numbers, values of any length are safe from overflow, and every result is shown three ways: hexadecimal, decimal and binary.

How It Works

Each input is parsed as hexadecimal (an optional 0x prefix is stripped automatically), converted to a big integer, and combined using the selected operator. Bitwise operators compare the numbers bit by bit; the arithmetic operators simply add, subtract or multiply the underlying values. The three result lines update on every keystroke, so you can see how AND masks bits, how XOR flips them, or how a hex addition carries into a new digit.

Real-World Use Case

Programmers debugging a bitmask or permission flag often need to AND two hex values to see which bits both share, or XOR them to spot the difference — this calculator does that instantly without opening a REPL or writing a throwaway script.

Frequently Asked Questions

Does it handle negative results?

Yes. Subtracting a larger hex value from a smaller one produces a negative result, shown with a minus sign in all three number bases rather than wrapping around like fixed-width binary arithmetic would.

Is there a limit on how large the numbers can be?

No practical one. The calculator uses JavaScript's BigInt type internally, so it handles hex values far longer than the 32 or 64 bits a typical calculator app would overflow at.

What does the AND operator actually do?

It compares the two numbers bit by bit and keeps a 1 only where both numbers have a 1, which is exactly how bitmasks are used to check or clear specific flags in code.

Whether you're comparing bitmasks, checking a checksum, or just adding two hex offsets together, the live three-base result panel saves a manual base-conversion step.

Found this useful? Share it