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

Bitwise calculator

Enter one number per line and pick an operation — AND, OR, XOR, NOT, shift left or shift right — 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 first. 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 the way it would in a real register, and the tool flags it as wrapped rather than pretending nothing happened. Signed mode reads and writes values as two's complement instead of plain unsigned, and for right shifts you can choose arithmetic (sign-preserving) or logical (zero-filling) — the distinction that decides whether >> on a negative number keeps its sign or not.

Turn on "Show operands aligned bit by bit" and the output adds the two operands and the result stacked underneath each other, one bit per column, with the operator and a divider line — the same layout you'd sketch on paper to check an AND or a shift by hand, generated instantly as you type. NOT and the shifts show a single operand row against the result; AND, OR and XOR show both.

Everything runs locally in your browser: numbers never leave your device, so it's safe to use with values that hint at how internal flags or protocol fields are built. 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 the second operand (or the shift amount for shift left/right) on line 2. NOT only reads line 1.
What base is the shift amount read in?
Always plain decimal, regardless of the input base you picked — it's a count of bits, not a value to convert.
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.