Bitwise Calculator Online
Apply AND, OR, XOR, NOT and bit shifts to two integers and read the result in binary, hex, decimal and octal — computed with BigInt in your browser.
The Bitwise Calculator runs entirely in your browser. The integers you type and every AND, OR, XOR, shift and NOT result are computed on your device and are never sent to ArrayKit or any server.
Open the Number Base Converter
About Bitwise Calculator
The Bitwise Calculator applies AND, OR, XOR, NOT and the three shift operators to two integers and shows every result in binary, hex, decimal and octal at once. Type each operand in whatever base you think in — decimal, hexadecimal (0xff), binary (0b1010) or octal (0o17) — and read back a grouped, per-bit view that lines the operands up column by column so you can see exactly which bits flipped. Because it computes with BigInt, a left shift like 1 << 40 gives the exact 1099511627776 instead of overflowing at 32 bits the way JavaScript's own operators do. It is built for embedded developers, driver and protocol authors, and anyone decoding register flags or permission masks. Every operand and result stays in your browser.
Features
- Compute AND, OR, XOR, NOT, and left, arithmetic-right and unsigned-right shifts
- Enter operands in decimal, hexadecimal, binary or octal, or let the 0x/0b/0o prefix decide
- Every result is shown in binary (grouped into nibbles), hex, decimal and octal side by side
- A stacked per-bit view aligns both operands and the result so flipped bits are obvious
- BigInt maths means shifts and large values never overflow the 32-bit boundary
- Switch between a 32-bit and 64-bit view for unsigned shifts and two's-complement output
- Negative and NOT results are displayed as clean two's-complement hex and binary
- Copy any base of the result with a single click
How to use the Bitwise Calculator
- Pick an operation — AND, OR, XOR, NOT, or a shift (<<, >>, >>>)
- Enter Value A, then Value B or a shift amount (NOT uses only A)
- Choose the input base, or leave it on Auto to read 0x, 0b and 0o prefixes
- Read the result in binary, hex, decimal and octal, and copy the base you need
Example
Input
A = 12
B = 10
op = AND
Output
BIN 1000
HEX 0x8
DEC 8
OCT 0o10
12 (1100) AND 10 (1010) keeps only the shared bit, giving 8 (1000).
Common errors & troubleshooting
- A left shift in another tool returned a surprisingly small number. — That tool likely used 32-bit integers, where 1 << 40 wraps around to 256. This calculator uses BigInt, so the shift keeps its full value of 1099511627776.
- NOT of a positive value shows a negative decimal. — That is correct: bitwise NOT equals -(n+1) in two's complement, so NOT 5 is -6. Read the HEX or BIN row to see the flipped bit pattern at the chosen width.
- Unsigned right shift (>>>) of a negative number looks wrong. — >>> zero-fills relative to the width. -1 becomes all ones first, so -1 >>> 28 is 15 at 32-bit. Switch to the 64-bit width to shift within 64 bits instead.
- The operand is rejected as invalid. — Match the digits to the base: hex allows 0-9 and a-f, binary only 0 and 1. Add a 0x/0b/0o prefix in Auto mode, or pick the base explicitly with the toggle.
Frequently asked questions
- Why does this bitwise calculator use BigInt instead of 32-bit integers?
- JavaScript's bitwise operators coerce their operands to 32-bit signed integers, so 1 << 40 overflows to 256 and large values lose their high bits. Computing with BigInt keeps every result exact no matter how big the number or the shift is.
- What is the difference between >> and >>> in the calculator?
- >> is an arithmetic right shift that preserves the sign bit, so -8 >> 1 is -4. >>> is a logical (unsigned) right shift that fills the top with zeros within the selected 32-bit or 64-bit width, so -1 >>> 28 is 15.
- Why is NOT of 5 shown as -6?
- Bitwise NOT inverts every bit, which in two's complement is the same as -(n+1). So NOT 5 is -6 in decimal. Look at the HEX and BIN rows to see the inverted bit pattern padded to the width you selected.
- Can I mix hexadecimal, binary and decimal operands?
- Yes. Set the input base explicitly, or leave it on Auto and prefix each value with 0x, 0b or 0o. The tool parses both operands, applies the operator, and reports the result in all four bases together.
- How do I read a negative result's hex or binary?
- Negative results are shown in two's complement at the selected width, so -6 reads as 0xfffffffa in 32-bit hex. The decimal row always stays signed and exact; switch to 64-bit if you need a wider bit pattern.
- What does the 32-bit versus 64-bit width setting change?
- The width controls where unsigned right shift zero-fills and how many bits the two's-complement hex, octal and binary use for negative or NOT results. The decimal value and logical AND/OR/XOR of positive numbers are unaffected.
Related tools
All ArrayKit tools