Binary Calculator

Perform bitwise AND, OR, XOR, NOT operations and left/right bit shifts with visu...

SecureFastFree

Updated

Input A15 · 0xF
0
0
0
0
1
1
1
1
Input B240 · 0xF0
1
1
1
1
0
0
0
0
Result
0000 0000
0
0
0
0
0
0
0
0
Dec: 0Hex: 0x00Bits: 0/8
AND (&)
0&0=0 0&1=0
1&0=0 1&1=1
OR (|)
0|0=0 0|1=1
1|0=1 1|1=1
XOR (^)
0^0=0 0^1=1
1^0=1 1^1=0
NOT (~)
~0=1 ~1=0
Flips all bits
Left Shift (<<)
0001<<1=0010
0011<<2=1100
Right Shift (>>)
1000>>1=0100
1100>>2=0011
SSL Secured
256-bit Encryption
Cloud Processing
Mobile Friendly

Calculator Features

Binary Input - Enter values directly in binary format
Bit Shifts - Left and right shift operations supported
Truth Tables - Reference tables for AND, OR, XOR operations
Bit Width Control - 8, 16, or 32-bit calculation modes
Copy Results - One-click copy to clipboard
Hex Display - View results in hexadecimal format

Why Use Binary Calculator?

6 Bitwise Operations

AND (&), OR (|), XOR (^), NOT (~), Left Shift (<<), and Right Shift (>>) - all in one tool.

Visual Bit Display

Color-coded bit-by-bit view shows exactly how each operation transforms your binary values.

8/16/32-Bit Modes

Switch between 8-bit (byte), 16-bit (word), and 32-bit (dword) calculation modes.

Binary, Decimal, Hex Output

See results in all three formats simultaneously. One-click copy to clipboard.

Live Calculation

Results update instantly as you type. No submit button needed.

Keyboard Shortcuts

Power users can use 1-6 for operations, a/b for inputs, c to copy results.

Common Use Cases

Permission Flags

Use OR to add permissions, AND to check if a flag is set, XOR to toggle.

Color Manipulation

Extract RGB channels from hex colors using AND with masks like 0xFF.

Fast Math

Left shift to multiply by powers of 2, right shift to divide efficiently.

Cryptography

XOR is fundamental to many encryption and hashing algorithms.

How It Works

1

Select Bit Width

Choose 8-bit, 16-bit, or 32-bit mode for your calculation.

2

Enter Binary Values

Input your binary numbers using only 0s and 1s.

3

Choose Operation

Select AND, OR, XOR, NOT, or bit shift operations.

4

View Results

See the result in binary, decimal, and hex formats with visual bit display.

Tips & Techniques

Masking Technique

Use AND with a mask to extract specific bits. For example, AND with 0x0F gets the lower 4 bits.

XOR for Toggling

XOR with 1 toggles a bit: 0 XOR 1 = 1, 1 XOR 1 = 0. Great for flipping flags.

Signed vs Unsigned

Be careful with right shifts on negative numbers. Arithmetic shift preserves the sign bit.

Frequently Asked Questions

AND compares each bit position: the result is 1 only when BOTH bits are 1. Example: 1010 & 1100 = 1000. Only bit 3 (from right) is 1 in both inputs, so only that bit is 1 in the result.
OR outputs 1 if either or both bits are 1 (inclusive). XOR outputs 1 only when bits are different (exclusive). Key difference: 1|1=1 but 1^1=0. XOR is used for toggling and encryption.
NOT flips all bits. In 8-bit mode: NOT 00001111 = 11110000 (decimal 240). The result depends on bit width - the same input gives 65520 in 16-bit mode. This calculator respects your selected bit width.
Left shift (<<) moves bits left, filling zeros on the right - equivalent to multiplying by 2 per shift. Right shift (>>) moves bits right, dividing by 2. Shifting 00001000 left by 2 gives 00100000.
Common uses: checking/setting flags (permissions, feature toggles), extracting color channels from hex values (RGB), fast multiplication/division by powers of 2, encryption algorithms, and network packet parsing.
Bit width determines the range: 8-bit (0-255), 16-bit (0-65535), 32-bit (0-4294967295). It also affects NOT results - NOT 0 in 8-bit is 255 (0xFF), but in 32-bit it's 4294967295 (0xFFFFFFFF).
To extract specific bits, AND with a mask. Example: to get the lower 4 bits of 11011010, AND with 00001111 to get 00001010. To set bits, use OR. To toggle bits, use XOR with your mask.
This calculator uses unsigned representation. In 8-bit: values range 0-255. For signed (two's complement), 10000000 through 11111111 would represent -128 to -1, but here they show as 128-255.

Related Tools