Bitwise Calculator
Calculate bitwise AND, OR, XOR, NOT, NAND, NOR, and bit shift operations on integer values with full binary representations.
Run tool
This online bitwise calculator performs fundamental binary logic operations on whole numbers. You can compute bitwise AND, OR, XOR, NOT, NAND, NOR, left shift, and right shift calculations directly in your browser. Enter your first integer into field A and your second integer into field B, then choose your preferred logic operator. Empty input boxes automatically default to zero. When you calculate unary negation with the NOT operator, the tool evaluates only the first number and marks the second operand as not applicable. For bit shift operations, make sure the shift count in the second field is zero or a positive integer, as negative shift distances cannot be evaluated. After running your calculation, the output panel displays the resulting integer along with detailed binary views formatted to a minimum width of eight bits. This side-by-side binary comparison lets you track individual bit flips, mask bits, and inspect shift outcomes clearly for programming, embedded systems, or computer science studies.
Instructions
- Enter an integer in field A.
- Enter a second integer in field B, or leave it blank to default to 0.
- Select or type your bitwise operation such as AND, OR, XOR, NOT, NAND, NOR, left-shift, or right-shift.
- Click Run to view the calculated integer result alongside formatted binary representations.
Examples
- Calculate 12 AND 5: Set A to 12 (binary 00001100), B to 5 (binary 00000101), and select AND to get 4 (binary 00000100).
- Shift bits left: Set A to 3 (binary 00000011), B to 2, and select left-shift to calculate 3 shifted left by 2 bits, yielding 12 (binary 00001100).
FAQ
How does the NOT operation handle the second input?
The NOT operation only acts on the first integer (A). The second input (B) is ignored during calculation, and its binary view is shown as not applicable.
Can I shift bits using negative numbers in the second input?
No. Left-shift and right-shift operations require a non-negative integer for the second operand (B).
What happens if I leave the input boxes blank?
Empty input boxes default to 0. You must select or type a bitwise operation such as AND, OR, XOR, NOT, NAND, NOR, left-shift, or right-shift before running the calculation.
Are operation names sensitive to letter case?
No. Operation names are evaluated without regard to uppercase or lowercase formatting.