Bitwise
Perform bitwise AND, OR, XOR, and NOT operations on integer values with this free bitwise calculator. See both decimal and binary representations of every result.
About This Calculator
This bitwise calculator performs AND, OR, XOR, and NOT operations on integer values. Bitwise operations work directly on the binary representation of numbers, manipulating individual bits rather than the numeric values as a whole. Each result is displayed as both a decimal number and its binary string representation with the 0b prefix.
Bitwise AND compares each bit position: the result bit is 1 only if both input bits are 1. Bitwise OR sets the result bit to 1 if at least one input bit is 1. Bitwise XOR (exclusive OR) sets the result bit to 1 if exactly one input bit is 1. Bitwise NOT is a unary operation that inverts every bit of the single input, including the sign bit.
This calculator is designed for programmers working with bitmasks and flags, embedded systems developers, computer science students studying digital logic, and anyone who needs to quickly verify bitwise operation results. The binary output uses JavaScript's >>> 0 conversion to display the unsigned 32-bit representation.
Frequently Asked Questions
What is a bitwise operation?
A bitwise operation operates on individual bits of integer values. AND sets each bit to 1 only if both corresponding bits are 1. OR sets each bit to 1 if at least one corresponding bit is 1. XOR sets each bit to 1 if exactly one corresponding bit is 1. NOT inverts all bits of a single value.
How is bitwise AND different from logical AND?
Bitwise AND (&) operates on each bit of the binary representations independently, producing a numeric result. Logical AND (&&) operates on boolean values and returns true or false. For example, 5 & 3 = 1 (bitwise), while true && false = false (logical).
What are bitwise operations used for?
Bitwise operations are used in low-level programming for setting, clearing, and testing individual bits in flags or registers. They are essential in embedded systems, graphics programming (bitmask operations), cryptography, network protocol implementation, compression algorithms, and performance-critical code where bit manipulation is needed.
How does the NOT operation work?
The NOT operation (~) inverts every bit of the input number, including the sign bit. In JavaScript, ~x equals -(x+1). For example, ~5 = -6. The calculator shows both the signed decimal result and its unsigned binary representation (using 0b prefix with the >>> 0 conversion).
Is this tool free to use?
Yes, all calculators on Calculy are completely free to use with no registration or subscription required.
Can I use negative numbers?
Yes, you can enter negative numbers. JavaScript represents negative numbers using two's complement internally, and the bitwise operations work on the 32-bit signed integer representation. The result is displayed as both a signed decimal value and an unsigned binary string.