Binary Calculator

Binary calculators let you perform arithmetic and number conversions entirely in base-2, the language that every computer, microcontroller, and digital circuit speaks natively. Whether you're a student wrestling with a computer science assignment or an engineer sanity-checking a bitwise operation, having a dedicated tool saves time and catches the small mistakes that are easy to make when working with long strings of ones and zeros. This page covers binary addition, subtraction, multiplication, and division, plus conversions between binary, decimal, hexadecimal, and octal. You'll also find the underlying rules, worked examples, and a plain-English explanation of how the binary number system actually works.

Enter Details

Operation

Binary 1

Binary 2

Result

Binary arithmetic

Note — This result is an estimate. Talk to a healthcare provider for personalized guidance.

How to Use the Binary Calculator

Using a binary calculator is straightforward. Enter your first binary number in the top input field and your second binary number in the field below it. Select the operation you want: add, subtract, multiply, or divide. Hit Calculate, and the result appears instantly, usually alongside a step-by-step breakdown so you can follow the logic rather than just trust the output.

A few things to keep in mind before you start:

  • Only enter 0s and 1s. Any other character will trigger an error because they don't exist in binary.
  • If you're subtracting or dividing, make sure you understand whether the calculator handles signed numbers (negative values represented with two's complement) or only unsigned values. Most basic tools assume unsigned.
  • For conversion tasks, use the dedicated converter sections rather than trying to trick the arithmetic fields.

The step-by-step output is worth reading even when you already know the answer. It shows carries, borrows, and partial products in a way that makes the underlying process click.

Binary Addition Calculator

Binary addition works almost exactly like decimal addition. You move column by column from right to left, add the digits, and carry any overflow to the next column. The only real difference is that you're carrying at 2 instead of 10.

The four possible single-bit addition cases are simple:

  • 0 + 0 = 0, carry 0
  • 0 + 1 = 1, carry 0
  • 1 + 0 = 1, carry 0
  • 1 + 1 = 0, carry 1 (because 2 in decimal is written as 10 in binary)

When a carry comes in from the previous column, you're effectively adding three bits at once (the two operand bits plus the carry bit). That can produce a sum bit of 1 and a carry of 1 simultaneously, which is totally normal. The calculator handles all of that automatically and shows the carry row so you can trace every step.

Binary Subtraction Calculator

Subtraction in binary follows the same right-to-left logic, but instead of carries you deal with borrows. When the top digit is smaller than the bottom digit (trying to do 0 minus 1), you borrow from the next column to the left, which turns that 0 into a 10 in binary (the value 2 in decimal), making the subtraction possible.

The basic cases:

  • 0 - 0 = 0
  • 1 - 0 = 1
  • 1 - 1 = 0
  • 0 - 1 = 1, borrow 1 from the next column

Borrowing can cascade across multiple columns if several consecutive digits are zero, which is where manual calculations go wrong most often. The calculator tracks each borrow explicitly so you can see exactly where the chain started and ended.

Many computer systems actually perform subtraction using two's complement addition rather than true subtraction. The two's complement of a number is its bitwise inverse plus 1, and adding that to the minuend gives the correct difference. If the calculator offers a two's complement mode, it's worth trying once just to see how the hardware actually does it.

Binary Multiplication Calculator

Binary multiplication is, honestly, easier than decimal multiplication in one respect: you never have to memorize a times table beyond four cases. Any bit times 0 is 0, and any bit times 1 is itself. The complexity comes from adding up all the partial products, not from the individual multiplications.

The process mirrors long multiplication by hand:

  1. Write out the multiplicand.
  2. For each bit of the multiplier (right to left), if the bit is 1, write a copy of the multiplicand shifted left by the bit's position. If the bit is 0, write all zeros for that row.
  3. Add all the partial product rows together using binary addition.

The result can be significantly wider than either input. Multiplying two 8-bit numbers can produce a 16-bit result, so pay attention to bit width if you're working within a specific register size. The calculator will show each partial product row before summing them, making the whole process transparent.

Binary Division Calculator

Binary division is the trickiest of the four operations, but the mechanics are familiar if you've ever done long division by hand. You work through the dividend bit by bit from left to right, asking at each step whether the divisor fits into the current partial dividend. The answer in binary is always just 0 or 1, which is actually simpler than the guessing game you play in decimal long division.

Here's the basic flow:

  1. Bring down bits from the dividend one at a time until the partial dividend is greater than or equal to the divisor.
  2. If it fits, write a 1 in the quotient and subtract the divisor from the partial dividend.
  3. If it doesn't fit, write a 0 in the quotient and bring down the next bit.
  4. Repeat until all bits of the dividend are used.

Any leftover amount after all bits are processed is the remainder. Binary division doesn't produce fractional binary digits automatically unless the calculator is set up for fixed-point or floating-point arithmetic. For most introductory purposes, you'll get an integer quotient and a remainder, which is exactly what the calculator displays.

Binary Arithmetic Rules

All four binary operations follow from the same small set of ground rules. Knowing these cold makes it much easier to check a calculator's output or work through a problem on paper.

OperationRuleResult
Addition1 + 10, carry 1
Addition1 + 1 + 1 (with carry)1, carry 1
Subtraction0 - 11, borrow 1
Multiplication1 × 11
Multiplication1 × 0 or 0 × 10
Division1 ÷ 11
Division0 ÷ 10

Division by zero is undefined in binary just as it is in decimal. The calculator will return an error if you attempt it. Everything else in binary arithmetic flows from the rules above plus the concept of positional notation, which works identically to decimal but with base 2 instead of base 10.

Carry and Borrow in Binary Operations

Carries and borrows are what make multi-bit binary arithmetic work. They're the mechanism by which a result that's too large (or too small) for a single bit position gets propagated to the adjacent column.

Carry happens in addition. When two or more bits in the same column sum to 2 or more, the excess is carried one position to the left. A carry of 1 represents the value of the next higher bit position. If you add 1 + 1 + 1 (two operand bits plus an incoming carry), you get binary 11, meaning the current column writes a 1 and sends another carry of 1 to the left.

Borrow works the opposite way in subtraction. When you can't subtract the bottom digit from the top digit (0 minus 1), you borrow from the column to the left. That borrowed 1 is worth 2 in the current column (because each position is worth twice the one to its right), which makes the subtraction possible. The column you borrowed from then has its value reduced by 1, which might trigger another borrow further left.

In hardware, carry propagation is one of the key design challenges in building fast adders. Circuits like the carry-lookahead adder were invented specifically to resolve long carry chains without waiting for each stage to finish before the next one starts. For our purposes though, just knowing how to track a carry or borrow manually is enough to catch errors and understand what the calculator is showing you.

Binary to Decimal Converter

Converting binary to decimal means figuring out what value a binary number represents in the base-10 system we use every day. The process is mechanical: each bit position corresponds to a power of 2, and you add up the powers that have a 1 in their column.

Starting from the rightmost bit (position 0) and moving left, the place values are 1, 2, 4, 8, 16, 32, 64, 128, and so on, doubling each time. For any binary number, multiply each bit by its place value and sum the results.

For example, the binary number 1011 converts like this:

  • Rightmost bit (position 0): 1 × 1 = 1
  • Position 1: 1 × 2 = 2
  • Position 2: 0 × 4 = 0
  • Position 3: 1 × 8 = 8
  • Total: 1 + 2 + 0 + 8 = 11 in decimal

The converter on this page handles any length binary string and returns the decimal equivalent instantly. Just paste your binary value in, and the result shows up along with the expanded form so you can verify the math.

Decimal to Binary Converter

Going the other direction, from decimal to binary, uses repeated division by 2. You divide the decimal number by 2, note the remainder (either 0 or 1), then divide the quotient again by 2. Keep going until the quotient reaches 0. Reading the remainders from bottom to top gives you the binary equivalent.

Walk through an example with the decimal number 25:

  1. 25 ÷ 2 = 12, remainder 1
  2. 12 ÷ 2 = 6, remainder 0
  3. 6 ÷ 2 = 3, remainder 0
  4. 3 ÷ 2 = 1, remainder 1
  5. 1 ÷ 2 = 0, remainder 1

Reading remainders from bottom to top: 11001. You can verify this by converting back: 16 + 8 + 0 + 0 + 1 = 25. The converter automates all of these steps, but doing one by hand at least once makes the logic stick.

Binary to Hexadecimal and Octal Conversion

Hexadecimal (base 16) and octal (base 8) are popular partly because they compress binary strings into something more readable. Programmers and hardware designers use them constantly because the conversion from binary is clean and lossless.

Binary to hexadecimal: Group the binary digits into sets of 4, starting from the right. Pad the leftmost group with leading zeros if it has fewer than 4 bits. Then replace each group with its hex digit using the table below.

BinaryHexDecimal
000000
000111
010044
100199
1010A10
1111F15

Binary to octal: Same idea, but group into sets of 3 bits instead of 4. Each group maps to a single octal digit (0 through 7). For instance, binary 110 111 becomes octal 67.

The converter handles both directions and both bases. If you need to go from hex or octal back to binary, just reverse the grouping: expand each digit back into its 4-bit (hex) or 3-bit (octal) equivalent and concatenate.

Binary Number System Explained

The binary number system uses exactly two digits: 0 and 1. That's it. Every number, no matter how large, gets expressed as some combination of those two values arranged in a sequence of bit positions.

Why base 2? Because digital electronics are built on switches that are either off (0) or on (1). There's no reliable way to distinguish 10 different voltage levels in a physical circuit, but distinguishing two states is robust and fast. So binary isn't just a math curiosity; it's the natural language of hardware.

Each position in a binary number is called a bit (short for binary digit). Groups of bits have standard names:

  • Nibble: 4 bits
  • Byte: 8 bits
  • Word: typically 16, 32, or 64 bits depending on the system architecture

Binary arithmetic obeys all the same mathematical laws as decimal arithmetic: commutativity, associativity, distributivity. The base is different, but the algebra is identical. That's why you can apply everything you know about arithmetic to binary once you internalize the place values and the carry/borrow rules.

Binary Calculation Formula and Methods

There's no single formula for all binary calculations, but there are clean formulas for the most common tasks.

Converting binary to decimal:

For a binary number with digits bnbn-1...b1b0, the decimal value is:

Value = bn × 2n + bn-1 × 2n-1 + ... + b1 × 21 + b0 × 20

Each bit is weighted by its positional power of 2, and you sum only the positions where the bit is 1.

Two's complement (for negative numbers): Flip all bits, then add 1. This gives the additive inverse of the original number in binary, which lets hardware perform subtraction using only adder circuits.

Bitwise shifts as multiplication/division: Shifting a binary number one position to the left multiplies it by 2. Shifting one position to the right divides by 2 (integer division). Shifting left by n positions multiplies by 2n. This is why compilers often replace simple multiply and divide operations with shifts: they're much faster in hardware.

These methods aren't just theoretical. They show up in low-level programming, digital circuit design, data compression, and cryptography regularly.

Binary Calculation Examples

Seeing the operations worked out in full makes the rules concrete. Here are four examples, one for each operation.

Addition: 1101 + 1011

  • Column 0 (rightmost): 1 + 1 = 0, carry 1
  • Column 1: 0 + 1 + carry 1 = 0, carry 1
  • Column 2: 1 + 0 + carry 1 = 0, carry 1
  • Column 3: 1 + 1 + carry 1 = 1, carry 1
  • Column 4 (new): carry 1
  • Result: 11000 (which is 24 in decimal; 13 + 11 = 24, checks out)

Subtraction: 1110 - 0101

  • Column 0: 0 - 1, borrow: 10 - 1 = 1, borrow from column 1
  • Column 1: 1 - 1 - 1 (borrow) = 1, borrow from column 2
  • Column 2: 1 - 1 - 1 (borrow) = 1, borrow from column 3
  • Column 3: 1 - 0 - 1 (borrow) = 0
  • Result: 1001 (which is 9 in decimal; 14 - 5 = 9, checks out)

Multiplication: 101 × 11

  • 101 × 1 (rightmost bit) = 101
  • 101 × 1 (next bit), shift left 1 = 1010
  • Add: 101 + 1010 = 1111 (which is 15 in decimal; 5 × 3 = 15, checks out)

Division: 1100 ÷ 11

  • 11 goes into 11 (first two bits of 1100) once. Quotient bit: 1. Subtract: 11 - 11 = 00.
  • Bring down next bit: 0. 11 doesn't go into 0. Quotient bit: 0.
  • Bring down next bit: 0. 11 doesn't go into 00. Quotient bit: 0.
  • Result: quotient 100, remainder 0 (which is 4 in decimal; 12 ÷ 3 = 4, checks out)

Binary Place Values and Bits

Understanding place values is the foundation of everything else in binary. Just as the decimal number 352 means 3 hundreds, 5 tens, and 2 ones, a binary number assigns a specific power of 2 to each bit position.

The table below shows the place values for a standard 8-bit (one byte) number:

Bit PositionPower of 2Decimal Value
7 (leftmost)27128
62664
52532
42416
3238
2224
1212
0 (rightmost)201

An 8-bit unsigned integer can represent values from 0 (all bits off: 00000000) to 255 (all bits on: 11111111). That's 256 distinct values total, which is 28. In general, n bits can represent 2n different values.

The rightmost bit is called the least significant bit (LSB) because it contributes the smallest value (1). The leftmost bit is the most significant bit (MSB) because it contributes the largest value. When you see a binary number written out, the MSB is always on the left, matching the convention we use in decimal.

Bit width matters practically. If a calculation produces a result wider than the allocated bits, the overflow bits get dropped, which can cause incorrect results in programs that don't account for it. Understanding place values helps you predict when overflow is likely and design around it.

Other Maths Calculators

Explore all