Skip to content
Categories
Bitwise Calculator
Calculate the result of bitwise operations such as AND, OR, XOR, NOT, and shifts, shown in decimal, binary, and hexadecimal.
Overview
- Calculates AND, OR, XOR, and shift operations on two values, and a NOT operation on a single value, showing the result in decimal, binary, and hexadecimal.
- Values are treated as 32-bit unsigned integers (0 to 4294967295).
- Useful for checking combinations of permission flags or verifying logic that uses bitmasks.
Usage
- Select the operation.
- Enter value A (and value B, for operations other than NOT).
- Click the "Calculate" button to see the result in decimal, binary, and hexadecimal.
Example
Input
A: 12, B: 10, Operation: AND
Output
8 (binary: 1000, hex: 8)
Use Cases
- Checking the resulting value when combining multiple permission flags with an OR operation
- Verifying whether a specific flag is set using an AND operation with a bitmask
- Checking whether the result of a shift operation is as expected before implementing it in code
FAQ
Can I enter negative numbers?
No. Only 32-bit unsigned integers in the range 0 to 4294967295 are supported.
Why does the result of a NOT operation become such a large number?
NOT flips every bit of a 32-bit unsigned integer, so for example NOT of 0 becomes 4294967295 (all bits set to 1).
Is there a limit on the shift amount (value B)?
Yes. To stay within the 32-bit integer range, the shift amount must be between 0 and 31.
Notes
- Right shift is calculated as an unsigned (logical) shift.
- This tool performs all calculations in your browser, and the values you enter are never sent anywhere.
Related Tools
Convert numbers between binary, octal, decimal, and hexadecimal.
Format HTML to make it easier to read.