Bitwise Calculator

Perform bitwise AND, OR, XOR, NOT, NAND, NOR and shifts on integers, with decimal, binary and hexadecimal results.

100% FreeNo sign-upPrivate — runs in your browser
—

Result (decimal)

Decimal
—
Binary
—
Hexadecimal
—
Operation
—

Copied to clipboard

How to use this tool

1
Enter two integers

Enter two whole numbers A and B.

2
Choose the operation

Choose AND, OR, XOR, NAND, NOR, NOT, left shift or right shift.

3
Choose display width

Choose 8, 16 or 32 bits for the binary and hex display.

4
Read decimal, binary and hex

Read decimal, binary and hexadecimal results.

Formula & worked example

AND, OR, XOR, NAND = NOT(AND), NOR = NOT(OR) and NOT act bit by bit. A << B multiplies by 2^B; A >> B divides by 2^B (arithmetic shift).

12 AND 10 is 8 (00001000 in binary); 12 OR 10 is 14, 12 XOR 10 is 6, and NOT 12 is -13.

Limitations — read this before you rely on it

32-bit signed integer semantics only: inputs beyond that range wrap, and fractional inputs are rejected.

Frequently asked questions

The standard way computers store negative integers: NOT flips every bit, so ~12 becomes -13 in 32-bit signed arithmetic.

So the result fits the chosen width; the decimal result still shows the full signed value.

Left shift multiplies by powers of two, right shift divides by powers of two, dropping dropped bits.

NOT-AND and NOT-OR: the negations of AND and OR, used heavily in digital logic.

JavaScript bitwise operators work on 32-bit signed integers, so this tool matches that standard behaviour.