Bitwise AND
Compute the bitwise AND operation between two integers. Free online AND calculator shows decimal and binary results for digital logic and programming applications.
About This Calculator
This calculator computes the bitwise AND (&) operation between two integers. Enter any two integers and the calculator returns the result in decimal and binary format.
Bitwise AND is a fundamental operation in computer programming and digital logic design. It compares each bit position independently: if both corresponding bits are 1, the result bit is 1; otherwise it's 0.
Frequently Asked Questions
What is bitwise AND?
Bitwise AND (&) compares each bit of two integers. If both bits are 1, the result bit is 1; otherwise 0. For example, 12 (1100) & 7 (0111) = 4 (0100).
How do you calculate bitwise AND?
Convert both numbers to binary, align them by their least significant bits, then apply: 1 & 1 = 1, 1 & 0 = 0, 0 & 1 = 0, 0 & 0 = 0. The calculator does this automatically.
What is bitwise AND used for?
Bitwise AND is used for masking (extracting specific bits), checking if a number is odd/even (n & 1), clearing bits, checking flag values in programming, and network subnet mask calculations.
Does the order matter in bitwise AND?
No. Bitwise AND is commutative: A & B = B & A. The operation also follows the associative property: (A & B) & C = A & (B & C).
Can I use bitwise AND with negative numbers?
Yes, the calculator supports negative integers. In most systems, negative numbers are represented in two's complement form, so be aware that the result will also be in two's complement.
Is this tool free?
Yes, all calculators on Calculy are completely free to use with no registration required.