Binary Calculator
Convert between binary and decimal numbers. Perform binary arithmetic operations with step-by-step solutions.
Binary
101010
Step-by-Step Solution
- 142 ÷ 2 = 21 remainder 00
- 221 ÷ 2 = 10 remainder 11
- 310 ÷ 2 = 5 remainder 00
- 45 ÷ 2 = 2 remainder 11
- 52 ÷ 2 = 1 remainder 00
- 61 ÷ 2 = 0 remainder 11
- 7Read remainders bottom to top: 101010101010
- 8Verification: 101010 in binary = 42 in decimal
Powers of 2 Reference
Common Binary Numbers
Related Calculators
About This Calculator
"How do I convert binary to decimal?" This question puzzles countless students, programmers, and curious minds every day. Binary numbers—those mysterious strings of 0s and 1s—are the foundation of all modern computing, yet most people find them intimidating at first glance.
Here is what makes binary so fascinating: your computer, smartphone, and every digital device you use speaks binary natively. When you type "Hello" on your keyboard, your computer sees something like "01001000 01100101 01101100 01101100 01101111." Every photo, video, song, and website is stored as binary data. Understanding binary is not just academic—it is the key to understanding how technology works at its core.
Our Binary Calculator makes working with binary numbers effortless. Convert any decimal number to binary instantly, translate binary sequences back to decimal, and perform arithmetic operations (addition, subtraction, multiplication, and division) all in base 2. What sets this calculator apart is the step-by-step conversion process—we show you exactly how each conversion works so you can learn the method, not just get the answer.
Whether you are a computer science student learning about number systems, a programmer debugging code, an electronics enthusiast working with microcontrollers, or simply curious about how computers think, this calculator provides both quick answers and educational insights. The binary system dates back to ancient civilizations, but it was mathematician Gottfried Wilhelm Leibniz who formalized it in 1679—over 250 years before the first electronic computer. Today, binary is more relevant than ever in our digital world.
How to Use the Binary Calculator
- 1**Select your conversion mode**: Choose "Decimal to Binary", "Binary to Decimal", or "Binary Arithmetic" from the mode selector.
- 2**Enter your number**: For decimal input, type any whole number (positive or negative). For binary input, enter only 0s and 1s.
- 3**For arithmetic operations**: Select the operation (add, subtract, multiply, divide) and enter two binary numbers.
- 4**View the result**: The calculator instantly displays the converted value or arithmetic result.
- 5**Study the step-by-step process**: Expand the steps section to see exactly how the conversion or calculation was performed.
- 6**Use the copy button**: Click to copy results to your clipboard for use in other applications.
- 7**Try different examples**: Experiment with various numbers to build your understanding of binary.
Understanding Binary: The Language of Computers
What is Binary? Binary is a base-2 number system that uses only two digits: 0 and 1. Unlike our everyday decimal system (base-10) which uses ten digits (0-9), binary represents all values using just these two symbols.
Why Binary? Computers use binary because electronic circuits have two natural states:
- ON (1): Electric current flowing, high voltage
- OFF (0): No current, low voltage
This on/off nature makes binary perfect for digital electronics. Every piece of data in your computer—text, images, videos, programs—is ultimately stored as binary.
Place Values in Binary: Just as decimal has ones, tens, hundreds places, binary has:
| Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Power of 2 | 2^7 | 2^6 | 2^5 | 2^4 | 2^3 | 2^2 | 2^1 | 2^0 |
Example: Binary 1101
- Position 3: 1 × 8 = 8
- Position 2: 1 × 4 = 4
- Position 1: 0 × 2 = 0
- Position 0: 1 × 1 = 1
- Total: 8 + 4 + 0 + 1 = 13
Converting Decimal to Binary
The Division Method (Most Common): Repeatedly divide by 2 and record the remainders from bottom to top.
Example: Convert 42 to Binary
| Step | Division | Quotient | Remainder |
|---|---|---|---|
| 1 | 42 ÷ 2 | 21 | 0 |
| 2 | 21 ÷ 2 | 10 | 1 |
| 3 | 10 ÷ 2 | 5 | 0 |
| 4 | 5 ÷ 2 | 2 | 1 |
| 5 | 2 ÷ 2 | 1 | 0 |
| 6 | 1 ÷ 2 | 0 | 1 |
Read remainders bottom to top: 101010 So, 42 in decimal = 101010 in binary
Verification: 32 + 8 + 2 = 42 ✓
The Subtraction Method (Alternative): Find the largest power of 2 that fits, subtract, and repeat.
Example: Convert 42 to Binary
- 42 - 32 (2^5) = 10 → Position 5 = 1
- 10 - 8 (2^3) = 2 → Position 3 = 1
- 2 - 2 (2^1) = 0 → Position 1 = 1
- Remaining positions = 0
Result: 101010 ✓
Converting Binary to Decimal
The Position-Value Method: Multiply each digit by its position value and sum the results.
Example: Convert 11010110 to Decimal
| Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Binary Digit | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 |
| Place Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Calculation | 128 | 64 | 0 | 16 | 0 | 4 | 2 | 0 |
Sum: 128 + 64 + 16 + 4 + 2 = 214
Quick Mental Math Tips:
- Memorize powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024
- 11111111 (eight 1s) = 255 (maximum 8-bit value)
- 10000000 (1 followed by seven 0s) = 128
Common Binary Numbers to Memorize:
| Binary | Decimal | Significance |
|---|---|---|
| 1 | 1 | Smallest positive |
| 10 | 2 | First power of 2 |
| 100 | 4 | Second power |
| 1000 | 8 | Byte half |
| 10000 | 16 | Hexadecimal base |
| 11111111 | 255 | Max 8-bit value |
| 100000000 | 256 | 2^8 |
Binary Arithmetic Operations
Binary Addition: Similar to decimal addition, but carries occur at 2 instead of 10.
Rules:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 10 (0, carry 1)
- 1 + 1 + 1 = 11 (1, carry 1)
Example: 1011 + 1101
1011 (11 in decimal)
+ 1101 (13 in decimal)
------
11000 (24 in decimal) ✓
Binary Subtraction: Use borrowing when needed, or use the two's complement method.
Rules:
- 0 - 0 = 0
- 1 - 0 = 1
- 1 - 1 = 0
- 0 - 1 = 1 (borrow 1 from left)
Example: 1101 - 1001
1101 (13)
- 1001 (9)
------
0100 (4) ✓
Binary Multiplication: Multiply each digit and shift, just like decimal multiplication.
Example: 101 × 11
101 (5)
× 11 (3)
-----
101 (101 × 1)
101 (101 × 1, shifted)
-----
1111 (15) ✓
Binary Division
Binary Division: Similar to long division in decimal, but simpler since you only use 0 and 1.
Example: 1110 ÷ 10 (14 ÷ 2 = 7)
111
------
10 | 1110
10
--
11
10
--
10
10
--
0
Result: 111 (which is 7 in decimal) ✓
Division Quick Reference:
| Binary Division | Decimal Equivalent | Result |
|---|---|---|
| 1000 ÷ 10 | 8 ÷ 2 | 100 (4) |
| 1100 ÷ 11 | 12 ÷ 3 | 100 (4) |
| 10000 ÷ 100 | 16 ÷ 4 | 100 (4) |
| 11110 ÷ 10 | 30 ÷ 2 | 1111 (15) |
Remainder (Modulo): When division does not result in a whole number:
- 1011 ÷ 100 = 10 remainder 11
- (11 ÷ 4 = 2 remainder 3)
Binary in Computing
Data Units:
| Unit | Bits | Bytes | Range (Unsigned) |
|---|---|---|---|
| Bit | 1 | 1/8 | 0-1 |
| Nibble | 4 | 1/2 | 0-15 |
| Byte | 8 | 1 | 0-255 |
| Word | 16-64 | 2-8 | Varies |
Common Bit Widths:
- 8-bit: 0 to 255 (2^8 - 1)
- 16-bit: 0 to 65,535 (2^16 - 1)
- 32-bit: 0 to 4,294,967,295 (2^32 - 1)
- 64-bit: 0 to 18.4 quintillion (2^64 - 1)
Binary in Everyday Tech:
| Technology | Binary Application |
|---|---|
| IP Addresses | 32 bits (IPv4), 128 bits (IPv6) |
| Colors (RGB) | 24 bits (8 per channel) |
| Audio CDs | 16-bit samples |
| Unicode | Up to 21 bits per character |
| WiFi | Binary-encoded radio signals |
File Sizes:
- 1 KB = 1,024 bytes = 2^10
- 1 MB = 1,048,576 bytes = 2^20
- 1 GB = 1,073,741,824 bytes = 2^30
- 1 TB = 2^40 bytes
Negative Numbers in Binary
Representing Negative Numbers: Computers use several methods to represent negative binary numbers.
Sign-Magnitude: The leftmost bit indicates sign (0 = positive, 1 = negative).
- +5 = 0101
- -5 = 1101
Problem: Two representations of zero (0000 and 1000)
Two's Complement (Most Common): To get the negative: invert all bits, then add 1.
Example: Find -5 in 8-bit two's complement
- Start with +5: 00000101
- Invert all bits: 11111010
- Add 1: 11111011
So -5 = 11111011 in two's complement
Two's Complement Range (8-bit):
- Maximum: 01111111 = +127
- Minimum: 10000000 = -128
- Range: -128 to +127
Why Two's Complement?
- Single representation of zero
- Addition works the same for positive and negative
- Subtraction becomes addition of the negative
Example: 5 + (-3) using two's complement
00000101 (+5)
+ 11111101 (-3)
----------
00000010 (+2) ✓
Binary and Other Number Systems
Number System Comparison:
| System | Base | Digits | Example (decimal 255) |
|---|---|---|---|
| Binary | 2 | 0, 1 | 11111111 |
| Octal | 8 | 0-7 | 377 |
| Decimal | 10 | 0-9 | 255 |
| Hexadecimal | 16 | 0-9, A-F | FF |
Binary to Hexadecimal (Easy Conversion): Group binary digits into sets of 4 from right to left.
| Binary | Hex | Binary | Hex |
|---|---|---|---|
| 0000 | 0 | 1000 | 8 |
| 0001 | 1 | 1001 | 9 |
| 0010 | 2 | 1010 | A |
| 0011 | 3 | 1011 | B |
| 0100 | 4 | 1100 | C |
| 0101 | 5 | 1101 | D |
| 0110 | 6 | 1110 | E |
| 0111 | 7 | 1111 | F |
Example: Convert 11010110 to Hexadecimal
- Split: 1101 | 0110
- Convert: D | 6
- Result: D6
Why Programmers Use Hexadecimal:
- Shorter than binary (1 hex digit = 4 bits)
- Easy conversion to/from binary
- Common for memory addresses, colors (#FF5733), MAC addresses
Pro Tips
- 💡Memorize powers of 2 up to 256: 1, 2, 4, 8, 16, 32, 64, 128, 256. This makes mental conversions much faster.
- 💡When converting decimal to binary, check your work by converting back—the result should match your original number.
- 💡Remember that 11111111 (eight 1s) equals 255. This is the maximum value for one byte.
- 💡For binary addition, remember: 1+1=10 in binary (write 0, carry 1). It is the same concept as 9+1=10 in decimal.
- 💡Use grouping when converting long binary numbers: group by 4s for hex, or by 3s for octal.
- 💡When subtracting binary numbers, borrowing works like decimal: 10 - 1 = 1 (but 10 in binary is 2 in decimal).
- 💡In programming, prefixes indicate number systems: 0b (binary), 0x (hex), 0o (octal). E.g., 0b1010 = 10.
- 💡The leftmost 1 in a binary number tells you the minimum number of bits needed to represent it.
- 💡For quick estimation: 2^10 is about 1,000, so 2^20 is about a million, and 2^30 is about a billion.
- 💡Binary multiplication by powers of 2 is simple—just add zeros to the right (like multiplying by 10 in decimal).
- 💡When debugging code, use hex to view memory because it is more readable than binary but still shows bit patterns.
- 💡Remember: computers always round binary fractions, which is why 0.1 + 0.2 does not exactly equal 0.3 in most programming languages.
Frequently Asked Questions
The easiest method is repeated division by 2. Divide your decimal number by 2 and write down the remainder (0 or 1). Continue dividing the quotient by 2 until you reach 0. Then read the remainders from bottom to top. For example, to convert 13: 13÷2=6 R1, 6÷2=3 R0, 3÷2=1 R1, 1÷2=0 R1. Reading bottom to top: 1101. Our calculator shows each step to help you learn.

