Bitwise Calculator
Calculate AND, OR, XOR, NOT and bit shifts on 32-bit values online. Enter operands in any base and see results in decimal, hex, octal and binary at once.
32-bit binary view — 12 & 10
| bit | 31 27 23 19 15 11 7 3 |
| A | 0000 0000 0000 0000 0000 0000 0000 1100 |
| B | 0000 0000 0000 0000 0000 0000 0000 1010 |
| out | 0000 0000 0000 0000 0000 0000 0000 1000 |
What is the Bitwise Calculator?
The ByteTools Bitwise Calculator performs AND, OR, XOR, NOT, left shift, arithmetic right shift and logical (unsigned) right shift on 32-bit integers — the exact semantics of JavaScript, C and Java.
- All seven core operations: & | ^ ~ << >> >>>
- Mixed-base input — each operand has its own base
- Result in signed decimal, unsigned decimal, hex and octal at once
- Stacked 32-bit binary view of operands and result
- True 32-bit semantics identical to JavaScript, C and Java
- 100% client-side and instant
How to use the Bitwise Calculator
- 1
Enter operand A and pick its base (decimal, hex, binary or octal).
- 2
Enter operand B the same way — for shifts, B is the shift amount.
- 3
Choose the operation: AND, OR, XOR, NOT, <<, >> or >>>.
- 4
Read the result in all four bases and compare the stacked binary rows.
- 5
Copy the result bits with one click.
About the Bitwise Calculator
The ByteTools Bitwise Calculator performs AND, OR, XOR, NOT, left shift, arithmetic right shift and logical (unsigned) right shift on 32-bit integers — the exact semantics of JavaScript, C and Java. Each operand can be entered in decimal, hexadecimal, binary or octal independently, so you can AND a hex mask against a decimal value directly.
The result is shown simultaneously as signed decimal, unsigned decimal, hex and octal, plus a 32-bit binary view that stacks the operands above the result so you can see exactly which bits changed. Shift amounts are taken modulo 32, matching how real CPUs and languages behave.
Everything is computed instantly and 100% locally in your browser — nothing you enter is uploaded or stored.
Frequently asked questions
What do AND, OR and XOR actually do?
They combine two numbers bit by bit. AND outputs 1 only where both bits are 1 — used for masking bits off. OR outputs 1 where either bit is 1 — used for setting flags. XOR outputs 1 where the bits differ — used for toggling bits and simple checksums. For example, 12 AND 10 is 8, because only the 8-bit is set in both.
What is the difference between >> and >>>?
Both shift bits right, but >> (arithmetic shift) copies the sign bit into the vacated positions, keeping negatives negative, while >>> (logical shift) always fills with zeros. So -8 >> 1 is -4, but -8 >>> 1 is 2147483644, because the sign bit becomes an ordinary value bit.
Why does the calculator show both signed and unsigned decimal?
The same 32 bits can be read two ways: as two's complement (signed, -2147483648 to 2147483647) or as a plain unsigned value (0 to 4294967295). 0xFFFFFFFF is -1 signed but 4294967295 unsigned. Showing both avoids the single most common source of bitwise confusion.
Why is my shift by 32 doing nothing?
Like JavaScript, Java and x86 hardware, the calculator uses only the low 5 bits of the shift amount, so shifting by 32 is shifting by 0 and shifting by 33 is shifting by 1. This modulo-32 rule is standard 32-bit behaviour, not a bug.
Does NOT really turn 12 into -13?
Yes. NOT inverts all 32 bits, and in two's complement ~x always equals -x-1, so ~12 is -13 and ~0 is -1. If you expected only the low bits to flip, AND the result with a width mask like 0xFF.
Is anything computed on a server?
No. All operations run in your browser using JavaScript's native 32-bit bitwise instructions. Nothing you enter is transmitted or stored.
Guides for Bitwise Calculator
Related tools
Binary Calculator
Do arithmetic and bitwise math on binary, decimal, hex and octal numbers — add, subtract, multiply, divide, AND, OR, XOR and shifts, with results in all bases.
Two's Complement Calculator
Convert signed decimals to two's complement binary and hex — and back — at 8, 16, 32 or 64 bits, with the invert-and-add-one steps shown. Free online tool.
Hex to Binary Converter
Convert hexadecimal to binary online with 4-bit or 8-bit grouping and zero-padding to 8, 16, 32 or 64 bits. Handles 0x prefixes and long values. No upload.
Binary to Hex Converter
Convert binary to hexadecimal online. Separators are ignored, bits are padded to whole nibbles, with uppercase and 0x prefix options. Fast, free and private.
IEEE 754 Floating Point Converter
Convert decimals to IEEE 754 single or double precision and back. See sign, exponent and mantissa bits, the exact stored value and the rounding error.