Bitwise Calculator
Apply AND, OR, XOR, NOT, NAND, NOR, shifts and rotates to numbers of 8, 16, 32 or 64 bits and see the result in decimal, hex and binary.
How to do bitwise operations
Enter A and B
Decimal, or with a 0x or 0b prefix.
Choose the operation and width
8, 16, 32 or 64 bits.
Read the result
Every value has its own Copy button.
Worked example
This is what Bitwise Calculator gives for its own sample values. Open the tool above and change anything to try your own.
- First number (A)
- 0xF0F0
- Operation
- A AND B
- Second number (B)
- 0x0FF0
- Width
- 32 bits
- Input base
- Detect (0x, 0b, 0o or decimal)
Result
- A
- 00000000000000001111000011110000
- B
- 00000000000000000000111111110000
- Result (binary)
- 00000000000000000000000011110000
- Result (hex)
- 0x000000F0
- Result (unsigned)
- 240
- Result (signed)
- 240
About Bitwise Calculator
Apply AND, OR, XOR, NAND, NOR, XNOR, NOT, left and right shifts and rotates to numbers of fixed width. The operands and result are shown in binary, hex, signed and unsigned, so overflow and sign are clear.
FAQs
What is the difference between the two right shifts?
A logical shift fills with zeros. An arithmetic shift copies the sign bit, so negative numbers stay negative.
Why are my numbers cut off?
They are limited to the width you choose. A number wider than that loses its high bits.
Can I change bases?
Use Number Base Converter.