IP331.com | Online Tools
HomeBase ConverterBinary Bitwise Calculator

Binary Bitwise Calculator

Enter binary numbers to perform AND, OR, XOR, NOT, left shift, and right shift operations

Value A (binary)
Value B (binary, for AND/OR/XOR/shift)
Select Operation

Bitwise Operation Rules

AND: 1&1=1, otherwise 0   Used to clear or mask specific bits
OR: 0|0=0, otherwise 1   Used to set bits
XOR: 1 if different, 0 if same   Used to toggle specific bits
NOT: 0→1, 1→0   Bitwise complement
Left shift (<<): shift left, fill 0   Equivalent to ×2ⁿ
Right shift (>>): shift right, fill sign bit   Equivalent to ÷2ⁿ

Bitwise operations are among the most fundamental low-level computer operations, playing an irreplaceable role in performance optimization and low-level programming.

The result of NOT is -(original + 1) in two\'s complement. For shift operations, value B indicates the number of bit positions to shift (must be a non-negative integer).

What Are Bitwise Operations?

Bitwise operations directly manipulate individual binary digits, including logical operations (AND, OR, XOR, NOT) and shift operations (left shift, right shift). They are the most fundamental low-level computer operations, far more efficient than arithmetic operations.

Logical Operations

AND clears bits, OR sets bits, XOR toggles bits, NOT inverts bits. Each operator works independently on every bit position.

Shift Operations

Left shifting by n bits is equivalent to multiplying by 2ⁿ; right shifting by n bits is equivalent to dividing by 2ⁿ (floor). Widely used in integer multiplication/division optimization.

Performance

Bitwise operations are executed directly by CPU hardware circuits in a single clock cycle, tens of times faster than multiplication and division.

Typical Uses

Permission control (rwx bits), status flag management, color value extraction (ARGB 8 bits each), fast hash computation, data verification, and encryption.

💡 Teaching Example: A=1010₂(10), B=1100₂(12). AND: 1010&1100=1000₂(8); OR: 1010|1100=1110₂(14); XOR: 1010^1100=0110₂(6); NOT(A)=~(1010)=-1011₂(-11).

Applications

Permission Control Image Processing Encryption Digital Circuits Competitive Programming

Frequently Asked Questions

What do AND, OR, and XOR mean in bitwise operations?
AND: 1 only if both bits are 1, otherwise 0. OR: 1 if at least one bit is 1. XOR: 1 if bits differ, 0 if they are the same. These are the three basic binary bitwise operations.
What do left shift and right shift do?
Left shift (<<) moves all bits left, filling with 0 on the right, equivalent to multiplying by 2ⁿ. Right shift (>>) moves bits right, filling with the sign bit on the left, equivalent to dividing by 2ⁿ (floor division).
What are the practical uses of bitwise operations in programming?
Bitwise operations are extremely efficient. Common uses: permission control (e.g., Linux file permissions rwx=111₂), flag setting and checking, fast multiply/divide by powers of 2, color value extraction (RGB channel splitting), encryption algorithms, and data compression.
Why does NOT of a number plus the original equal -1?
NOT flips all bits (0→1, 1→0). In two's complement representation, a number plus its bitwise NOT equals -1 (all bits set to 1). For example, 5 (0101₂) NOT'd is -6 (1010₂), and 5 + (-6) = -1.

More Base Converter Tools

Free online calculators and tools covering mathematics, unit conversion, text processing, and daily life. Accurate, fast, mobile-friendly, and completely free to use.

© 2026 IP331.com — Free Online Tools. All rights reserved.

About · Contact · Privacy Policy · Cookie Policy · Terms of Use · Disclaimer · Sitemap