Skip to main content
01

Binary Calculator

Convert between binary and decimal numbers. Perform binary arithmetic operations with step-by-step solutions.

Binary

101010

Decimal Input42
Bit Length6 bits

Step-by-Step Solution

  1. 1
    42 ÷ 2 = 21 remainder 00
  2. 2
    21 ÷ 2 = 10 remainder 11
  3. 3
    10 ÷ 2 = 5 remainder 00
  4. 4
    5 ÷ 2 = 2 remainder 11
  5. 5
    2 ÷ 2 = 1 remainder 00
  6. 6
    1 ÷ 2 = 0 remainder 11
  7. 7
    Read remainders bottom to top: 101010101010
  8. 8
    Verification: 101010 in binary = 42 in decimal

Powers of 2 Reference

2^0
1
2^1
2
2^2
4
2^3
8
2^4
16
2^5
32
2^6
64
2^7
128

Common Binary Numbers

0
0
1
1
10
1010
15
1111
16
10000
100
1100100
128
10000000
255
11111111

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. 1**Select your conversion mode**: Choose "Decimal to Binary", "Binary to Decimal", or "Binary Arithmetic" from the mode selector.
  2. 2**Enter your number**: For decimal input, type any whole number (positive or negative). For binary input, enter only 0s and 1s.
  3. 3**For arithmetic operations**: Select the operation (add, subtract, multiply, divide) and enter two binary numbers.
  4. 4**View the result**: The calculator instantly displays the converted value or arithmetic result.
  5. 5**Study the step-by-step process**: Expand the steps section to see exactly how the conversion or calculation was performed.
  6. 6**Use the copy button**: Click to copy results to your clipboard for use in other applications.
  7. 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:

Position76543210
Value1286432168421
Power of 22^72^62^52^42^32^22^12^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

StepDivisionQuotientRemainder
142 ÷ 2210
221 ÷ 2101
310 ÷ 250
45 ÷ 221
52 ÷ 210
61 ÷ 201

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

Position76543210
Binary Digit11010110
Place Value1286432168421
Calculation128640160420

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:

BinaryDecimalSignificance
11Smallest positive
102First power of 2
1004Second power
10008Byte half
1000016Hexadecimal base
11111111255Max 8-bit value
1000000002562^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 DivisionDecimal EquivalentResult
1000 ÷ 108 ÷ 2100 (4)
1100 ÷ 1112 ÷ 3100 (4)
10000 ÷ 10016 ÷ 4100 (4)
11110 ÷ 1030 ÷ 21111 (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:

UnitBitsBytesRange (Unsigned)
Bit11/80-1
Nibble41/20-15
Byte810-255
Word16-642-8Varies

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:

TechnologyBinary Application
IP Addresses32 bits (IPv4), 128 bits (IPv6)
Colors (RGB)24 bits (8 per channel)
Audio CDs16-bit samples
UnicodeUp to 21 bits per character
WiFiBinary-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

  1. Start with +5: 00000101
  2. Invert all bits: 11111010
  3. 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:

SystemBaseDigitsExample (decimal 255)
Binary20, 111111111
Octal80-7377
Decimal100-9255
Hexadecimal160-9, A-FFF

Binary to Hexadecimal (Easy Conversion): Group binary digits into sets of 4 from right to left.

BinaryHexBinaryHex
0000010008
0001110019
001021010A
001131011B
010041100C
010151101D
011061110E
011171111F

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.

Nina Bao
Written byNina BaoContent Writer
Updated January 17, 2026

More Calculators You Might Like