Add, subtract, multiply or divide two binary numbers, or convert a number between binary and decimal.
Enter two binary numbers, made of 0s and 1s only, and pick an operation.
Convert a binary number to a decimal number.
Convert a whole decimal number to binary.
| Decimal | Binary | Decimal | Binary |
|---|---|---|---|
| 0 | 0 | 8 | 1000 |
| 1 | 1 | 10 | 1010 |
| 2 | 10 | 16 | 10000 |
| 3 | 11 | 20 | 10100 |
| 4 | 100 | 64 | 1000000 |
| 7 | 111 | 255 | 11111111 |
The binary system counts in base 2. Where decimal uses ten digits, 0 to 9, and each place is worth ten times the one to its right, binary uses only 0 and 1, and each place is worth twice the one to its right. The binary number 1011 is 1 × 8, plus 0 × 4, plus 1 × 2, plus 1 × 1, which is 11 in decimal. Computers use binary because it is easy to build circuits that detect only two states, on and off.
Addition, subtraction, multiplication and division follow the same rules as in decimal, except you carry or borrow when a column reaches 2 instead of 10. In addition, 1 + 1 is 10, which is a 0 with a carry of 1. This calculator does the sums exactly, for numbers of any length, and shows the matching decimal calculation so you can check the answer. Division gives a whole quotient and a remainder.
To convert binary to decimal, add up the place value of every 1. To convert decimal to binary, divide the number by 2 again and again and write down the remainders from last to first. The calculators above do both directions for you. Negative numbers are shown with a minus sign, not in the two’s complement form that computer hardware uses.
Add the bits column by column from the right. 0 + 0 is 0, 0 + 1 is 1, and 1 + 1 is 10, so write 0 and carry 1 to the next column.
Multiply each bit by 2 raised to its position, counting from 0 at the right, and add the results. For 1011 that is 8 + 0 + 2 + 1, which is 11.
Divide the number by 2 repeatedly and keep the remainders. Reading the remainders from the last to the first gives the binary number. For example, 11 gives 1011.
The calculator gives a whole number quotient and a remainder, both in binary and decimal. Division by zero is not possible.
You can use a minus sign for a negative whole number. Fractional binary numbers, with a binary point, are not supported.
Pick another tool to jump straight to it.