Calcoid

Bitwise Calculator

Run bitwise AND, OR, XOR, NOT, shifts, and binary conversions for signed and unsigned integer values.

Bitwise Calculator

Operands must be 0 to 255.

Integer 0 to 7. Applied to A only.

A AND B (8-bit)

8

0b00001000 . 0x08

A OR B

14

0b00001110

0x0E

A XOR B

6

0b00000110

0x06

NOT A

243

0b11110011

0xF3

NOT B

245

0b11110101

0xF5

A << 1 (left shift)

24

0b00011000

0x18

A >> 1 (right shift)

6

0b00000110

0x06

Operands in this width

A = 120b00001100 . 0x0C
B = 100b00001010 . 0x0A

Frequently Asked Questions about the Bitwise Calculator

What does this bitwise calculator do?
It applies the core bitwise operators to two whole numbers, A and B. You get A AND B, A OR B, A XOR B, NOT A, NOT B, plus A shifted left and right by the number of bits you choose. Every result is shown in decimal, binary, and hexadecimal so you can check the bit pattern directly.
How do AND, OR, and XOR work bit by bit?
These operators compare A and B one bit at a time. AND sets a result bit to 1 only when both input bits are 1. OR sets it to 1 when at least one input bit is 1. XOR sets it to 1 when exactly one input bit is 1, which makes XOR useful for toggling bits and simple parity checks.
Why does NOT depend on the bit width?
NOT flips every bit, so the answer depends on how many bits make up the number. In an 8-bit word, NOT 12 is 255 minus 12, which is 243. In a 16-bit word the same input gives 65,523. Pick the width (8, 16, 32, or 64) that matches your data type so NOT and the shifts match your system.
What is the difference between left shift and right shift?
A left shift moves every bit toward the high end and fills the low end with zeros, which doubles the value once per position until bits fall off the top of the word. A right shift moves bits toward the low end. Because the operands here are treated as unsigned, the right shift fills the high end with zeros (a logical shift).
Why are negative numbers and large values rejected?
The calculator treats A and B as unsigned integers, so each value must be from 0 up to one less than 2 raised to the bit width (for example 0 to 255 at 8 bits). Negative, fractional, or out-of-range inputs return no result. The shift amount must be a whole number from 0 to the width minus one.
How precise is the 64-bit mode?
All math runs with arbitrary-precision integers (BigInt) rather than standard 64-bit floating point, so 64-bit results stay exact even above 9,007,199,254,740,991, the largest safely representable JavaScript integer. That means a value like NOT 0 at 64 bits returns the full 20-digit answer without rounding.

Related Calculators

More calculators in "Tech"

See all 98 calculators in "Tech"