Binary Calculator
1010 + 0011 = 1101, which is 13 in decimal. Use this binary calculator to add, subtract, multiply, or divide two binary numbers and see the answer in both binary and decimal right away. Enter only 0s and 1s, choose the operation, and the tool converts each input from base 2 into decimal, runs the arithmetic, then converts the result back to binary for display. That makes it useful for homework checks, coding practice, logic design review, and quick sanity checks when you want to confirm what a binary expression means without working through every carry or borrow on paper.
Quick answer
Each input must contain only binary digits, so valid entries look like 1010, 0011, or 111111.
What this tells you
- •Each input must contain only binary digits, so valid entries look like 1010, 0011, or 111111.
- •Leading zeros are allowed. 0011 and 11 represent the same value, but the extra zeros can make manual checking easier.
- •The result card shows the computed answer in binary and decimal, plus the decimal value of each input.
- •Division returns the integer quotient only. If the decimal answer would include a fraction or remainder, this tool rounds down by taking the whole-number quotient.
How to Use
- 1Enter the first binary number in Binary A. Enter only 0 and 1 digits with no spaces or prefixes.
- 2Enter the second binary number in Binary B. Use leading zeros if you want the numbers lined up for hand-checking, but they are optional.
- 3Choose Add, Subtract, Multiply, or Divide depending on the binary math problem you want to solve.
- 4Click Calculate to view the binary result, the decimal result, and the decimal interpretation of each input.
- 5If you are checking your own work, compare the decimal version first. It is often the fastest way to catch a carry, borrow, or division mistake.
How It Works
Formula
Parse binary to decimal -> apply arithmetic -> convert the result back to binaryBinary place values double as you move left, so 1010 means 1×8 + 0×4 + 1×2 + 0×1 = 10. This tool first parses each binary input into its decimal value, then applies the chosen operation. After that, it converts the decimal result back into a base-2 string for the main answer. For division, the tool returns the integer quotient by taking the whole-number result. Zero and positive results print in full at any size. A negative result between -2,147,483,648 and -1 prints as its 32-bit two's-complement pattern, and a negative result below that prints as a minus sign followed by the binary magnitude.
Calculation note: values are processed in the order shown above, using the current input units.
Worked Examples
Binary addition
1010 is 10 in decimal and 0011 is 3. Adding them gives 13, which is 1101 in binary. This is the basic pattern for checking carries in base-2 addition.
Binary subtraction
1101 is 13 and 0010 is 2. Subtracting gives 11, which converts back to 1011. This is a clean example for practicing binary borrowing without crossing into a negative result.
Binary multiplication
0110 is 6 and 0011 is 3. Multiplying gives 18, which is 10010 in binary. This mirrors the repeated-shift idea behind binary multiplication because 6×3 equals 6 + 12.
Binary division
1111 is 15 and 0010 is 2. The exact decimal result would be 7.5, but this tool returns the integer quotient only, so the displayed answer is 7, which is 111 in binary.
Scenario: Maya checks an 8-bit subtraction for a lab report
Maya's microcontroller lab stores values in 8-bit registers, and she needs 5 minus 8. Run 1 returns decimal -3 with the 32-bit two's-complement pattern. She keeps the lowest 8 bits, 11111101, which is how an 8-bit register holds -3. Read as unsigned it is 253, or 256 minus 3. To check it, she adds 8 back in Run 2 and gets 100000101, decimal 261. The ninth bit is the carry an 8-bit register throws away, which leaves 00000101, or 5, the number she started with.
Binary arithmetic results as this calculator prints them
Each row is one calculation run through this binary calculator, with the binary and decimal lines exactly as the tool shows them (no zero padding, no commas). The last five rows cover the 32-bit edge, where the rule for printing negative results changes and positive results keep going.
| Calculation | Binary result (as shown) | Decimal result | What it shows |
|---|---|---|---|
| 1 + 1 | 10 | 2 | The basic carry: write 0, carry 1 |
| 1010 + 0011 | 1101 | 13 | This page's default inputs, 10 + 3 |
| 1111 + 1 | 10000 | 16 | A carry that ripples through four columns |
| 11111111 + 1 | 100000000 | 256 | The ninth bit an 8-bit register would drop |
| 10000 - 1 | 1111 | 15 | A borrow that ripples through four columns |
| 1101 × 101 | 1000001 | 65 | Shift and add: 1101 + 110100 |
| 1111 ÷ 10 | 111 | 7 | 15 / 2 is 7.5, and the fraction is dropped |
| 1101101 ÷ 1000 | 1101 | 13 | Dividing by 8 drops the low three bits, like a right shift |
| 0 - 1 | 11111111111111111111111111111111 | -1 | 32-bit two's-complement pattern of -1 |
| 0 - 10000000 | 11111111111111111111111110000000 | -128 | Low 8 bits, 10000000, are the 8-bit pattern for -128 |
| 0 - 10000000000000000000000000000000 | 10000000000000000000000000000000 | -2147483648 | Lowest signed 32-bit value, the last one with a pattern |
| 0 - 100000000000000000000000000000000 | -100000000000000000000000000000000 | -4294967296 | Below -2^31 the tool prints a minus sign and the magnitude |
| 11111111111111111111111111111111 + 1 | 100000000000000000000000000000000 | 4294967296 | No 32-bit ceiling on positive results |
Every cell was produced by running the calculation through this tool's formula. Inputs are read with parseInt at a radix of 2 and results are written with Number.prototype.toString(2), both defined in ECMA-262. A negative result from -2,147,483,648 to -1 first goes through the unsigned right shift (>>> 0), which applies ECMA-262's ToUint32 operation, the value modulo 2^32. That is the 32-bit two's-complement pattern. To read a narrower register width, keep the lowest n bits of the pattern, which works for any value from -2^(n-1) to -1.
How binary math works in practical terms
Binary arithmetic looks strange at first because there are only two digits, but the logic is simpler than it seems. Each column can hold 0 or 1. Once a column would exceed 1, you carry into the next place, so 1 + 1 becomes 10: 0 in the current place and 1 carried into the twos place. Multiplication is shift and add. 1101 × 101 is 1101 plus 1101 shifted two places left (110100), which gives 1000001, or 65. Dividing by a power of two works the other way and drops bits from the right, so 1101101 ÷ 1000 keeps 1101 (13) and loses 101.
Reading the decimal lines is the fastest way to check your work. If 101101 feels abstract, read it as 32 + 8 + 4 + 1 = 45, then confirm the answer landed where you expected. Division is where expectations usually drift. This tool has no remainder field and no fractional binary expansion. It keeps the whole-number quotient only, so 1111 ÷ 0010 returns 111 because the decimal quotient 7.5 is cut down to 7.
Negative results use two's complement, the format the C23 standard now requires for signed integers. In n bits, a negative value x is stored as 2^n + x, so -1 in 8 bits is 11111111 and -128 is 10000000. One adder handles signed and unsigned values alike, and there is only one zero. This tool shows the 32-bit pattern, so -2 appears as 31 ones followed by a 0. To get a narrower width, keep the lowest n bits. The low 8 bits of the 32-bit pattern for -128 are 10000000, the same as the 8-bit pattern, and that trick holds for any value from -2^(n-1) to -1.
Under the hood the tool follows ECMA-262, the JavaScript standard. The parseInt function, with a radix of 2, reads each input, and Number.prototype.toString(2) writes the result. That method writes a negative number with a minus sign, so for results from -2,147,483,648 to -1 the tool first applies the unsigned right shift (>>> 0). It runs ECMA-262's ToUint32 operation, which takes the value modulo 2^32, and that remainder is the 32-bit two's-complement pattern. Below -2^31 the modulo stops meaning the same number. For example, -4,294,967,296 modulo 2^32 is 0, so the tool switches to a minus sign and the magnitude and prints -1 followed by 32 zeros.
ECMA-262 also defines every Number as an IEEE 754-2019 double-precision value with 53 significant bits. That is why Number.MAX_SAFE_INTEGER is 2^53 - 1, or 9,007,199,254,740,991, which is 53 ones in binary. Positive results have no 32-bit limit, so 32 ones plus 1 prints a 1 followed by 32 zeros, decimal 4,294,967,296. Past 53 bits the lowest bits stop being exact. Enter a 1, then 52 zeros, then a 1 (that is 2^53 + 1) and add 0. The tool returns 9,007,199,254,740,992 and the binary line ends in 0, because 2^53 + 1 has no double-precision value and rounds to its even neighbor. For 64-bit values, use a BigInt-aware tool.
Common mistakes
- Entering prefixes like 0b1010 or separators like spaces. This calculator accepts plain binary digits only.
- Expecting division to show a remainder or fractional binary output. It returns the integer quotient only.
- Assuming leading zeros change the value. They do not. 00101 and 101 both equal 5.
- Expecting a negative result to show a minus sign. Down to -2,147,483,648 the binary line shows the 32-bit two's-complement pattern instead, so -1 appears as 32 ones.
- Confusing a negative decimal result with signed binary input support. The tool can display a negative decimal answer after subtraction, but it does not accept signed binary notation as input.
Embed this calculator on your site
Paste this code where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use as long as the credit line stays in place.
<script src="https://calctide.com/embed.js" data-tool="binary-calculator" async></script>
<p style="font-size:12px;margin:4px 0 0">Binary Calculator by <a href="https://calctide.com/tech/binary-calculator/">CalcTide</a></p>Preview the embed at /embed/binary-calculator/.