Binary Calculator
0
Decimal value:
0
Decimal = (bn × 2n) + ... + (b0 × 20)
Example: Convert 1011 to Decimal
1011 = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11
1. Divide the number by 2
2. Record the remainder (0 or 1)
3. Repeat until the quotient is 0
4. Binary = remainders in reverse order
Example: Convert 11 to Binary
11 ÷ 2 = 5 R1
5 ÷ 2 = 2 R1
2 ÷ 2 = 1 R0
1 ÷ 2 = 0 R1
Binary = 1011
1. Convert binary to decimal
2. Perform arithmetic (+, −, ×, ÷)
3. Convert result back to binary
Example: 1010 + 0101
1010 = 10
0101 = 5
10 + 5 = 15 → Binary = 1111
Understanding the Binary Number System
The binary number system is a method of representing numbers using only two digits: 0 and 1. It works similarly to the decimal system, which uses ten digits (0–9), but binary is based on powers of 2 instead of 10. Each digit in a binary number is called a bit.
Binary is widely used in digital electronics and computing because it’s easy to represent two states—such as on/off or true/false—using 0 and 1. Designing circuits to handle just two values is much simpler than handling ten, making binary ideal for modern technology.
Common Binary to Decimal Conversions
Decimal | Binary |
---|---|
0 | 0 |
1 | 1 |
2 | 10 |
3 | 11 |
4 | 100 |
7 | 111 |
8 | 1000 |
10 | 1010 |
16 | 10000 |
20 | 10100 |
How Binary Numbers Work
Just like decimal uses powers of 10, binary uses powers of 2. For example:
In decimal:
8 = 8 × 10⁰ = 8
18 = (1 × 10¹) + (8 × 10⁰) = 10 + 8 = 18In binary:
8 = 1000 = (1 × 2³)
18 = 10010 = (1 × 2⁴) + (1 × 2¹) = 16 + 2 = 18Steps to Convert Decimal to Binary
Identify the largest power of 2 less than or equal to the number.
Subtract that value from the number.
Repeat the process with the remainder.
For each power of 2 used, mark a 1; for those not used, mark a 0.
Example: Convert 18 to Binary
2⁴ 2³ 2² 2¹ 2⁰ 1 0 0 1 0 Result: 10010
Converting Binary to Decimal
To convert binary to decimal, add up all the powers of 2 represented by bits with the value 1.
Example: 10111
(1 × 2⁴) + (0 × 2³) + (1 × 2²) + (1 × 2¹) + (1 × 2⁰)
= 16 + 0 + 4 + 2 + 1 = 23Binary Addition
Binary addition uses similar rules to decimal addition but with only two digits:
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10 (which is 0 with a carry of 1)
Example:
10111
+ 00011
————–
11010Carryover happens when a sum reaches 2 (binary 10), just like in decimal when a sum reaches 10.
Binary Subtraction
Binary subtraction also follows simple rules:
0 − 0 = 0
1 − 0 = 1
1 − 1 = 0
0 − 1 = 1 (with borrowing)
When borrowing, you take 1 from the next significant bit, turning 0 into 2 in binary.
Example:
11011
– 01101
————–
01110Borrowing works the same as in decimal subtraction but adapted for binary values.
Binary Multiplication
Binary multiplication is straightforward since the only digits are 0 and 1:
0 × 0 = 0
1 × 0 = 0
0 × 1 = 0
1 × 1 = 1
Just like in decimal multiplication, results are added together, and each row is shifted left.
Example:
10111
× 11
———–
10111
+ 101110
—————-
110001Multiplication in binary involves repeated additions and left shifts.
Binary Division
Binary division is similar to long division in decimal but uses binary subtraction:
Divide the dividend by the divisor using binary subtraction.
Record how many times the divisor “fits” into the current digits.
Continue until all digits are processed.
Example:00111 ← Quotient
_________
11 | 101101
11 ← 11 × 1 = 11
—–
100
11 ← 11 × 1 = 11
—-
11
11 ← 11 × 1 = 11
—
0 ← Remainder
A solid grasp of binary subtraction makes binary division easier to perform.