All tools

Bitwise Calculator

AND, OR, XOR, NOT, shift on two integers.

Bitwise results (32-bit)
A
dec 255
hex 0xFF
bin 0b00000000000000000000000011111111
B
dec 10
hex 0xA
bin 0b00000000000000000000000000001010
A AND B
dec 10
hex 0xA
bin 0b00000000000000000000000000001010
A OR B
dec 255
hex 0xFF
bin 0b00000000000000000000000011111111
A XOR B
dec 245
hex 0xF5
bin 0b00000000000000000000000011110101
NOT A
dec -256
hex 0xFFFFFF00
bin 0b11111111111111111111111100000000
NOT B
dec -11
hex 0xFFFFFFF5
bin 0b11111111111111111111111111110101
A << 10
dec 261120
hex 0x3FC00
bin 0b00000000000000111111110000000000
A >> 10 (arithmetic)
dec 0
hex 0x0
bin 0b00000000000000000000000000000000
A >>> 10 (logical)
dec 0
hex 0x0
bin 0b00000000000000000000000000000000

Shift count is taken from the low bits of B and clamped to the chosen width. NOT, shifts, and unsigned shift wrap inside the selected width.

About

Type two numbers (decimal, hex, or binary). See the result of every bitwise operation in all three bases. Useful for masking, flag math, and low-level debugging.

How to use

  1. Enter two numbers (any base).
  2. See AND, OR, XOR, NOT, and shifts in all bases.

FAQ

What's the difference between logical and arithmetic shift?+

Arithmetic right shift preserves the sign bit (negative stays negative). Logical right shift fills with zero. The tool shows both.

What size are the numbers?+

32-bit signed by default. Toggle for 64-bit (uses BigInt under the hood).