Bitwise Operations Calculator

Enter A (and B, for everything but NOT) and pick an operation — the result and its bit pattern update as you type.

How it works

A and B are treated as 32-bit unsigned integers (0 to 4,294,967,295). AND, OR, XOR, NOT, and the two shifts all run on the operands' actual bits — the result is displayed both as a decimal number and as its full 32-character binary pattern. B is ignored for NOT, since bitwise NOT only ever takes one operand.

One subtlety worth calling out: JavaScript's own ~ operator returns a signed result — ~5 is -6, not a positive number. This calculator instead shows the unsigned 32-bit reinterpretation of that same bit pattern (4294967290), since a tool built to answer "what are the bits" should show the bits, not a sign-extended number to puzzle over.