Binary Calculator
Use the following calculators to perform the addition, subtraction, multiplication, or division of two binary values, as well as convert binary values to decimal values, and vice versa.
1. Binary Calculation — Add, Subtract, Multiply, or Divide
2. Convert Binary Value to Decimal Value
3. Convert Decimal Value to Binary Value
Binary Number System
The binary system is a numerical system that works much like the decimal system people are familiar with. However, while the decimal system uses base 10, the binary system uses base 2. Instead of digits 0–9, binary uses only 0 and 1. Each digit in binary is known as a bit.
Despite these differences, operations like addition, subtraction, multiplication, and division follow rules similar to the decimal system.
Modern computers and digital systems rely on binary because it is easier to implement in hardware. Circuitry can be designed to detect only two states: on/off, true/false, or present/absent. Using decimal would require hardware that can detect 10 states, making it far more complex.
Binary and Decimal Conversion
Below are some typical conversions:
| Decimal | Binary |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 10 |
| 3 | 11 |
| 4 | 100 |
| 7 | 111 |
| 8 | 1000 |
| 10 | 1010 |
| 16 | 10000 |
| 20 | 10100 |
Understanding Place Values
Each binary place value represents 2n, just as decimal place values represent 10n. For example, in decimal:
8 = 8 × 100 = 8
18 = (1 × 101) + (8 × 100) = 10 + 8 = 18
In binary, 8 is represented as 1000. Reading right to left: 0 = 20, 0 = 21, 0 = 22, 1 = 23 → 8
For 18 in binary (10010): 18 = (1 × 24) + (0 × 23) + (0 × 22) + (1 × 21) + (0 × 20) = 16 + 2 = 18
Decimal to Binary Conversion Steps
- Find the largest power of 2 within the number.
- Subtract this value.
- Repeat with the remainder until it reaches 0.
- Mark each power of 2 found as 1, and the rest as 0.
Example: Converting 18
| 2n | 24 | 23 | 22 | 21 | 20 |
|---|---|---|---|---|---|
| Instances in 18 | 1 | 0 | 0 | 1 | 0 |
18 = (1 × 16) + (0 × 8) + (0 × 4) + (1 × 2) + (0 × 1) = 18 Binary = 10010
Binary to Decimal Conversion
Add up all place values where 1 occurs. Example: 10111 = (1 × 24) + (0 × 23) + (1 × 22) + (1 × 21) + (1 × 20) = 23
Binary Addition
Rules:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 0 (carry 1)
Binary Subtraction
Rules:
- 0 - 0 = 0
- 0 - 1 = 1 (borrow)
- 1 - 0 = 1
- 1 - 1 = 0
Binary Multiplication
Rules:
- 0 × 0 = 0
- 0 × 1 = 0
- 1 × 0 = 0
- 1 × 1 = 1
Binary Division
Binary division works like decimal long division, except subtraction uses binary rules. Example: 1010 ÷ 10 = 101 (10 in decimal ÷ 2 = 5 in decimal).
