Bitwise Calculator
Evaluate integer bitwise operations with the result shown in decimal, grouped 32-bit binary, and hex.
Compute AND, OR, XOR, NOT and bit shifts instantly. Free online bitwise calculator with decimal, 32-bit binary and hex output.
Calculator Inputs
About Bitwise Ops
Evaluate integer bitwise operations with the result shown in decimal, grouped 32-bit binary, and hex.
Bitwise operators work on the 32-bit two’s-complement form of integers. AND keeps bits set in both operands, OR keeps bits set in either, XOR keeps bits set in exactly one, NOT flips every bit, and the shifts move bits left or right (>>> always shifts in zeros).
The binary readout groups bits in bytes so flags line up visually; hex gives the compact register view. All math runs in your browser with JavaScript 32-bit semantics.
Where it is used
Building permission bitmasks, decoding flags and status registers, teaching binary arithmetic, and debugging shifts.
How to use the Bitwise Ops
- Value A (integer) — enter the value (e.g. 60).
- Operator — enter the value.
- Value B (ignored by NOT) — enter the value (e.g. 13).
- Calculate — press the Calculate button to see the result instantly above.
Formula
JS 32-bit semantics: & | ^ ~ << >> >>>. Negative numbers shown in two’s complement.
Examples
Example
Frequently Asked Questions
- Why is NOT 60 equal to −61?
- NOT flips all 32 bits including the sign bit, so ~x always equals −x − 1 in two’s complement. ~60 = −61.
- What is the difference between >> and >>>?
- >> preserves the sign by shifting in copies of the sign bit; >>> always shifts in zeros, so negative numbers become large positives.
- Why do large numbers behave oddly?
- Operands are coerced to 32-bit integers, so values beyond ±2^31 wrap. This matches C, Java, and JavaScript semantics exactly.