Bitwise Calculator – AND, OR, XOR, NOT, Shift

Perform bitwise operations on integers: AND, OR, XOR, NOT, and bit shift.

About This Calculator

Perform bitwise operations on integers: AND, OR, XOR, NOT, and bit shift. Use the calculator above for instant results.

Worked Examples

Example 1: 60 AND 13

  • 60 = 111100 | 13 = 001101 | AND = 001100 = 12

Answer: 12

Example 2: 60 OR 13

  • 111100 OR 001101 = 111101 = 61

Answer: 61

Example 3: 60 XOR 13

  • 111100 XOR 001101 = 110001 = 49

Answer: 49

Who Uses This Calculator?

💻
Programmers

Bit manipulation for systems programming.

🔧
Embedded Engineers

Hardware register bit manipulation.

🏫
CS Students

Bitwise operation practice.

🧪
Security Engineers

Cryptographic operations.

Common Mistakes to Avoid

❌ XOR with same value gives 0

a XOR a = 0. Used in cryptography (XOR cipher) and swap algorithms.

❌ Shift vs multiply

Left shift by n = multiply by 2^n. Right shift by n = divide by 2^n (integer). Faster than multiply on some hardware.

Frequently Asked Questions

Bitwise AND use cases?

Check if bit is set: val & (1<

XOR swap trick?

a ^= b; b ^= a; a ^= b; — swaps without temp variable. Clever but don't use in production code.

Bit shift tricks?

Left shift: fast multiply by power of 2. Right shift: fast divide. Test if power of 2: n & (n-1) == 0.