Bitwise Calculator (AND, OR, XOR, NOT & Bit Shift)

Apply bitwise AND, OR, XOR, NOT, NAND, NOR or a left/right bit shift to two numbers (decimal, 0x hex or 0b binary) at a chosen…

Results

Enter your details and click Calculate to see your results.
About This Calculator

AND keeps a bit only if both inputs have it, so it's used to mask bits out. OR sets bits. XOR flips the bits where B is 1. NOT inverts every bit within the chosen width.

A left shift by n multiplies by 2ⁿ, dropping bits that fall off the top. A right shift divides by 2ⁿ (logical shift).

Example

Example: 11001010 XOR 00001111 = 1100 0101 (197). XOR with 0x0F flips the low four bits.

Assumptions

Values are taken modulo 2^width; negative inputs are stored as two's complement. A right shift is logical (fills with zeros).

Frequently Asked Questions

What is XOR used for?

Toggling bits, simple checksums, parity, and swapping values without a temporary variable.

What does 1 << 4 equal?

16.

Related Calculators

About the Author

Imran Hossain
Imran Hossain

Professional SEO, Digital Marketer Specialist

I am a Certified Google Ads Expert And Professional SEO, Digital Marketing Specialist

View full profile