Bitwise Calculator
Perform bitwise operations on two numbers. Supports decimal and hex (0x) input.
Enter two numbers to perform bitwise operations.
Report a Problem
Found a bug or have a suggestion? Help us improve this tool.
What is this tool?
Bitwise calculator performs binary operations including AND, OR, XOR, NOT, LEFT SHIFT, and RIGHT SHIFT on integer values. Bitwise operations manipulate individual bits and are fundamental in low-level programming, network protocols, cryptography, and data compression.
How to use
- 1
Enter values
Input two integer operands.
- 2
Select operation
Choose AND, OR, XOR, NOT, <<, or >>.
- 3
View result
See result in decimal, binary, and hexadecimal.
Frequently Asked Questions
What does XOR do?
XOR (exclusive OR) returns 1 only when the two bits are different. 1 XOR 1 = 0, 0 XOR 0 = 0, 1 XOR 0 = 1. It is widely used in cryptography, error detection, and swapping variables without a temporary variable.
What bitwise operations are supported?
AND, OR, XOR, NOT, left shift, and right shift.
What is the difference between logical and arithmetic right shift?
Logical right shift (>>>) fills the leftmost bits with zeros regardless of sign. Arithmetic right shift (>>) preserves the sign bit โ it fills with 0 for positive numbers and 1 for negative numbers. In JavaScript, >> is arithmetic and >>> is logical. For positive numbers they produce the same result, but for negative numbers they differ.