How to use
- Choose what to do: calculate with two binary numbers, turn a binary number into decimal, or turn a decimal number into binary.
- To calculate, type the two binary numbers (only the digits 0 and 1) and pick add, subtract, multiply or divide. The answer appears as you type.
- Read the result in binary first, then the same number in decimal, octal and hexadecimal, how many bits it needs and how a computer would store it in two's complement.
- To convert, type one value. The working shows the place values for binary to decimal, or the repeated division by 2 for decimal to binary.
Formula
Each binary digit counts a power of 2, so 10111 = 1 x 16 + 0 x 8 + 1 x 4 + 1 x 2 + 1 x 1 = 23. To go the other way, divide by 2 again and again and read the remainders from the last to the first. Division gives a whole-number quotient and a remainder.Example
10101010 + 11001100 = 101110110, which is 170 + 204 = 374 in decimal. 1100100 divided by 111 is 1110 with remainder 10, which is 100 divided by 7 = 14 remainder 2. In India, the decimal side is grouped the Indian way, so 1,00,000 in binary is 11000011010100000.
Numbers can be up to 1,024 digits long and every digit stays exact. Negative numbers are shown with a minus sign; the two's complement line shows the bit pattern a computer uses, in the smallest whole number of bytes that holds the value. Only whole numbers are handled: digits after a decimal point are dropped when converting from decimal.