Binary Calculator
Perform binary arithmetic and convert between binary, decimal, and hexadecimal. Perfect for computer science, programming, and digital electronics.
Step-by-Step Solution
Enter values and click "Calculate" to see the step-by-step solution.
Binary Reference Table
| Decimal | Binary | Hexadecimal | Octal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 8 | 10 |
| 9 | 1001 | 9 | 11 |
| 10 | 1010 | A | 12 |
| 11 | 1011 | B | 13 |
| 12 | 1100 | C | 14 |
| 13 | 1101 | D | 15 |
| 14 | 1110 | E | 16 |
| 15 | 1111 | F | 17 |
What is Binary?
Binary is a base-2 number system that uses only two digits: 0 and 1. It's the fundamental language of computers, where each digit represents a bit (binary digit).
Binary Arithmetic Rules
- Addition: 0+0=0, 0+1=1, 1+0=1, 1+1=0 carry 1
- Subtraction: 0-0=0, 1-0=1, 1-1=0, 0-1=1 borrow 1
- Multiplication: Same as decimal, but simpler (0 or 1)
- Division: Similar to long division
Bitwise Operations
- AND (&): 1 if both bits are 1
- OR (|): 1 if at least one bit is 1
- XOR (^): 1 if bits are different
- NOT (~): Flips all bits
- Left Shift (<<): Moves bits left (multiplies by 2)
- Right Shift (>>): Moves bits right (divides by 2)
Binary Calculator: Master Binary Arithmetic & Conversions
What is Binary? Binary is a base-2 number system that uses only two digits: 0 and 1. Each binary digit is called a "bit" (binary digit). Computers use binary because transistors have two states: on (1) and off (0). Understanding binary is essential for computer science, programming, and digital electronics.
Binary to Decimal Conversion
To convert binary to decimal, multiply each bit by 2 raised to its position (starting from 0 on the right) and sum the results. For example: 1011₂ = 1×8 + 0×4 + 1×2 + 1×1 = 8 + 0 + 2 + 1 = 11₁₀
Decimal to Binary Conversion
Divide the decimal number by 2 repeatedly, recording remainders from bottom to top. For example: 13₁₀ = 13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → 1101₂
Binary Addition Rules
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 0 (carry 1)
- 1 + 1 + carry = 1 (carry 1)
Binary Subtraction Rules
- 0 - 0 = 0
- 1 - 0 = 1
- 1 - 1 = 0
- 0 - 1 = 1 (borrow 1)