Here is a bitwise and calculator, for performing an and between the bits of two numbers (once converted to 32-bit binary). In a bitwise and, a binary digit will only be set to 1 if both numbers have a 1 in that spot, otherwise it'll set to 0.
Bitwise And Calculator
Using the Bitwise And Calculator
To use the bitwise and calculator, enter two numbers to and in the "Number One" and "Number Two" fields in the tool. Once happy with your inputs, click the "Calculate Bitwise And" button.
The result of the bitwise and will show up in the "Anded Number" field, converted back to integer:
Bitwise And Example
Behind the scenes, the tool is converting both of your numbers to 32-bit binary numbers, then going digit by digit and anding the two numbers together. Let's do an example together, matching the screenshot (anding the numbers 4 and 5).
5\&4=4\\or\\ 101\&100=100\ (4)
As you can see in the above block, the tool converted the numbers 5 and 4 to the binary numbers 101 and 100, respectively. Moving in either direction, you can see the 4s digit was the only place where both numbers had a 1 – so the final result was 100.
100 is the same as 4, so the tool converts it back to a 4 and gives you the anded number. Contrast that with the same input to the bitwise or calculator, where 5 or 4 gives you 5, or the bitwise xor which gives you 1.
Other Binary Calculator
Try our other binary math calculators: