Skip to content
100% local

Bitwise calculator

Run AND, OR, XOR, NOT and bit shifts on two numbers and see the result bit by bit.

Input
Output

Bitwise calculator

Enter one number per line and pick an operation — AND, OR, XOR, NOT, shift left or right, rotate left or right, flip bits or reverse the bit order — to see the bitwise result instantly. It's built for the moment a calculator's decimal output isn't enough: checking a permission mask, debugging a flags field, working out what a shift actually does to a byte, or verifying a hand-computed two's complement value.

Read and write each operand in binary, octal, decimal or hexadecimal independently, so you can take a hex flag straight from a debugger and get a decimal or binary answer without a separate conversion step. Bit width (8, 16, 32 or 64) sets how many bits the operation works over: a value that doesn't fit wraps to that width exactly as it would in a real register, and the tool flags it. Signed mode reads and writes two's complement, and for right shifts you can choose arithmetic (sign-preserving) or logical (zero-filling).

The circular shifts, rotate left and rotate right, move bits out of one end and back in at the other within the chosen width, so nothing is lost the way it is with a plain shift — the ROL and ROR of hashing and cipher code. Bit flip inverts only the positions you list on line 2, such as 0, 3, 7, counting from the rightmost bit as 0. Bit reverse mirrors the whole width, so the lowest bit becomes the highest.

Turn on "Show operands aligned bit by bit" and the output adds the operands and the result stacked one bit per column, with the operator and a divider line — the layout you'd sketch on paper to check a result by hand.

Everything runs locally in your browser: numbers never leave your device. Copy the result, download it as a .txt file, or send it straight back into the input to chain another operation.

FAQ

What goes in the input?
One number per line: the first operand on line 1, and on line 2 the second operand, the shift or rotate count, or the bit positions to flip. Counts are always plain decimal, whatever the input base. NOT and bit reverse only read line 1.
How do rotate, bit flip and reverse work?
Rotate moves bits out of one end and back in at the other within the bit width, so rotating a byte left by 1 turns 10010110 into 00101101. Bit flip inverts the bit positions listed on line 2, counting the rightmost bit as 0. Bit reverse mirrors the order of all bits in the width.
What happens if a number is too big for the bit width?
It wraps to that width, the same way it would in a real register — the tool tells you it wrapped instead of silently truncating.
What's the difference between arithmetic and logical right shift?
Logical shift fills the vacated high bits with zero. Arithmetic shift fills them with the sign bit instead, so a negative signed number stays negative. The option only applies to shift right with signed values.
Is my input uploaded anywhere?
No. The bitwise calculator runs entirely in your browser — nothing you type is sent to a server.