Bitwise Calculator

Perform bitwise operations on binary numbers - AND, OR, XOR, NOT, left shift, right shift, and more.

Enter binary digits (0s and 1s)
Decimal: 45
Hexadecimal: 0x2D
Bit visualization:
Enter binary digits (0s and 1s)
Decimal: 51
Hexadecimal: 0x33
Bit visualization:

Bitwise Operations

Shift Operations

Operation Result

-
-
-
-

Bit-by-bit Operation

Bit Position A B Operation Result
Enter binary numbers and select an operation

Bitwise Operations Guide

What are Bitwise Operations?

Bitwise operations work directly on the binary representations of numbers, manipulating individual bits. Unlike logical operations, bitwise operations work on each bit position independently. These are fundamental to low-level programming, digital electronics, cryptography, and graphics programming.

Bitwise AND (&) Operation

Returns 1 only if both input bits are 1. Otherwise returns 0. Useful for masking and extracting specific bits.

A B A & B
000
010
100
111

Example: 101101 & 110011 = 100001

Bitwise OR (|) Operation

Returns 1 if at least one input bit is 1. Returns 0 only if both bits are 0. Used for setting bits and combining flags.

A B A | B
000
011
101
111

Example: 101101 | 110011 = 111111

Bitwise XOR (^) Operation

Returns 1 if input bits are different, 0 if they are the same. Used in cryptography and error detection.

A B A ^ B
000
011
101
110

Example: 101101 ^ 110011 = 011110

Bitwise NOT (~) Operation

Flips each bit: 0 becomes 1, and 1 becomes 0. This is a unary operation working on one operand.

Example: ~101101 = 010010 (in 6-bit representation)

Shift Operations (<< and >>)

Left Shift (<<): Moves bits left, filling with 0s on the right. Multiplies by 2 for each shift.

Right Shift (>>): Moves bits right. Divides by 2 for each shift (truncated).

Example: 101101 << 2 = 10110100 (multiply by 4)