TTKTheTextKit

Binary Calculator

Type two binary numbers and choose add, subtract, multiply or divide. The answer appears in binary and decimal, with hexadecimal and octal for whole results, and the written column method shows each carry, borrow or partial product. Binary points and negative numbers are accepted. Everything runs in your browser.

Decimal: 11

Decimal: 6

1011 + 110 in binary
10001
Binary
10001
Decimal
17
Hexadecimal
11
Octal
21

Column working

  111  
   1011
+   110
-------
  10001

The top row shows the 1s carried into each column.

Type 0s and 1s, with a point for a binary fraction and a minus sign for a negative number. Negative numbers are written with a sign, not in two's complement. Column working is shown for adding, subtracting and multiplying numbers that are zero or positive and up to 24 digits long. Everything runs in your browser.

Related Tools

[6 suggestions]

About the Binary Calculator

Binary is base 2: it has only the digits 0 and 1, and each place is worth twice the place to its right. 1011 means 8 plus 0 plus 2 plus 1, which is 11. Addition follows four rules: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10, so write 0 and carry 1, and 1 + 1 + 1 = 11, so write 1 and carry 1. For example, 1011 + 110 = 10001, which is 11 + 6 = 17. Subtraction works column by column from the right, and when the top digit is too small, the column borrows 1 from the left, which is worth 2 where it arrives. Multiplication is simpler than in decimal: for every 1 in the bottom number, copy the top number shifted left to that place, then add the rows. Division is long division where each step asks only whether the divisor fits once or not at all. When both numbers are whole, the calculator also gives the whole quotient and the remainder. A quotient may never end, even for small numbers: 1 divided by 11, which is one third, is 0.(01) in binary, with the digits in parentheses repeating. The same happens to one tenth, which is why many programming languages cannot store 0.1 exactly. The arithmetic uses exact whole numbers, so inputs of up to 256 digits are not rounded. Negative numbers are written with a minus sign. If you need the two’s complement bit patterns that processors use, or the AND, OR and XOR operations, use the bitwise calculator. Everything runs in your browser and nothing you type is uploaded.

How do you add binary numbers?▾

Line them up on the right and add column by column. Two 1s make 10, so write 0 and carry 1 to the next column. Three 1s make 11, so write 1 and carry 1.

How do you subtract in binary?▾

Subtract column by column from the right. If the top digit is smaller than the bottom one, borrow 1 from the column to the left, which adds 2 to the current column.

How do I check a binary answer?▾

Convert both numbers and the answer to decimal and do the same sum. The calculator shows the decimal value under each box and in the results.

Can binary numbers have a point?▾

Yes. Places after the point are worth one half, one quarter, one eighth and so on, so 101.11 is 5.75.

Why does 1 divided by 11 go on for ever?▾

Because 11 in binary is 3, and a fraction ends in binary only when its denominator is a power of 2. Otherwise the digits repeat, and they are shown in parentheses.

Is anything uploaded?▾

No. The calculation runs in your browser, and the numbers are not sent anywhere or stored.