Free Bitwise Calculator — AND, OR, XOR, NOT, Shift Operations (2026)
Six operations. Every low-level programming task depends on at least one of them. SmallSEOToolsn’s free bitwise calculator handles all six — AND, OR, XOR, NOT, Left Shift, and Right Shift — with instant results in binary, decimal, and hexadecimal.
KEY TAKEAWAYS
- A bitwise calculator performs all six fundamental bit operations: AND, OR, XOR, NOT, Left Shift, Right Shift.
- XOR is used in cryptography, checksums, and finding the unique element in an array.
- Left shift by n = multiply by 2ⁿ; Right shift by n = divide by 2ⁿ (integer division).
- Results displayed in binary, decimal, and hexadecimal simultaneously.
- Essential tool for CS students, embedded systems engineers, and security researchers.
All Six Bitwise Operations Explained
AND (&)
Output 1 only when both bits are 1. Used for masking and filtering.
- 12 & 10 = 8 (1100 & 1010 = 1000)
OR (|)
Output 1 when at least one bit is 1. Used for setting flags.
- 12 | 10 = 14 (1100 | 1010 = 1110)
XOR (^)
Output 1 when bits differ. Used in cryptography, error detection.
- 12 ^ 10 = 6 (1100 ^ 1010 = 0110)
NOT (~)
Inverts all bits. For 8-bit: ~12 = -13 (two’s complement), for unsigned: ~12 = 243.
- ~1100 = 0011 (for 4-bit unsigned = 3; in signed 8-bit = 243)
Left Shift (<<)
Shifts all bits left by n positions, filling right with 0s. Equivalent to × 2ⁿ.
- 3 << 2 = 12 (011 → 1100)
Right Shift (>>)
Shifts all bits right by n positions. Equivalent to ÷ 2ⁿ (floor).
- 12 >> 2 = 3 (1100 → 0011)
Complete Truth Table
| A | B | AND | OR | XOR | NOT A |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 |
Practical Applications
XOR in cryptography: XOR encryption XORs each byte of data with a key byte. XOR is self-inverse: A XOR B XOR B = A — decryption uses the same operation.
Finding unique element: Classic interview question: given an array where every element appears twice except one, find the unique element. XOR all elements — duplicate pairs cancel to 0, leaving the unique value.
Bit shift for fast math: x << 1 doubles x faster than multiplication on older CPUs. x >> 1 halves x. Used in optimized algorithms and embedded systems.
Setting bits with OR: flags | NEW_FLAG sets a specific bit without disturbing others.
Clearing bits with AND NOT: flags & ~CLEAR_FLAG clears a specific bit.
Toggling bits with XOR: flags ^ TOGGLE_FLAG flips a specific bit.
Code Examples (All Languages)
python
# Python - all six operations
a, b = 12, 10
print(a & b) # AND = 8
print(a | b) # OR = 14
print(a ^ b) # XOR = 6
print(~a) # NOT = -13 (signed)
print(a << 2) # Left Shift = 48
print(a >> 1) # Right Shift = 6
AI Overview Answer
What operations does a bitwise calculator perform? A bitwise calculator computes six fundamental operations on binary integers: AND (both bits must be 1), OR (either bit is 1), XOR (bits must differ), NOT (inverts all bits), Left Shift (multiply by 2^n), and Right Shift (divide by 2^n). These operations are fundamental to systems programming, cryptography, embedded development, and algorithm optimization.
FAQ
Q: What is XOR used for in programming? A: XOR is used for encryption (simple XOR ciphers), error detection (parity bits, CRC), cryptographic primitives, finding unique elements in arrays, and swapping variables without a temporary variable: a ^= b; b ^= a; a ^= b.
Q: How does left shift multiply by 2? A: Each left shift moves all bits one position left, which doubles the value. 3 in binary is 011. Left shift by 1: 110 = 6 (doubled). Left shift by 2: 1100 = 12 (multiplied by 4 = 2²).
→ Enter your values and select operation above for instant results.