Bitwise And Calculator

Written by:
PK

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 between the numbers 5 and 4 in the tool
Result of a bitwise and of 5 and 4

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:

      

PK

PK started DQYDJ in 2009 to research and discuss finance and investing and help answer financial questions. He's expanded DQYDJ to build visualizations, calculators, and interactive tools.

PK lives in New Hampshire with his wife, kids, and dog.

Don't Quit Your Day Job...

DQYDJ may be compensated by our partners if you make purchases through links. See our disclosures page. As an Amazon Associate we earn from qualifying purchases.
Sign Up For Emails
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram