Binary Calculator

Perform binary arithmetic and bitwise operations

Input

Result

Binary Number System

Basic Concepts

Binary System: Base-2 number system using only 0s and 1s
Bit: Single binary digit (0 or 1)
Byte: 8 bits (e.g., 10101010)
Conversion: Each position represents a power of 2

Arithmetic Operations

Addition: 0+0=0, 0+1=1, 1+0=1, 1+1=10
Subtraction: 0-0=0, 1-0=1, 1-1=0, 10-1=1
Multiplication: 0×0=0, 0×1=0, 1×0=0, 1×1=1
Division: Similar to decimal division

Bitwise Operations

AND (&): 1 if both bits are 1, else 0
OR (|): 1 if either bit is 1, else 0
XOR (^): 1 if bits differ, else 0
NOT (~): Inverts all bits

Examples

1010 + 1100 = 10110 (10 + 12 = 22)
1010 & 1100 = 1000 (10 AND 12 = 8)
1010 | 1100 = 1110 (10 OR 12 = 14)
1010 ^ 1100 = 0110 (10 XOR 12 = 6)