Bitwise Calculator

Perform bitwise AND, OR, XOR, NOT, left shift, and right shift operations on integers. Shows binary, decimal, octal, and hex representations with a visual bit display.

Bitwise Operations Reference

Bitwise operations work directly on the binary representation of integers. They are used for permission flags (Unix chmod), network masks (CIDR), hardware register manipulation, and performance-critical arithmetic.

Operations

AND (&) - bit is 1 only if both inputs are 1. Used to mask bits: flags & MASK
OR (|) - bit is 1 if either input is 1. Used to set bits: flags | FLAG
XOR (^) - bit is 1 if inputs differ. Used to toggle bits: flags ^ TOGGLE
NOT (~) - inverts all bits. Useful with AND to clear a bit: flags & ~FLAG
LEFT SHIFT (<<) - shifts bits left, equivalent to multiplying by 2ⁿ
RIGHT SHIFT (>>) - shifts bits right, equivalent to integer dividing by 2ⁿ

Related tools