Binary Calculator

Use the following calculators to perform the addition or subtraction of two binary values, convert from binary value to decimal value or vice versa. Please note that due to the limitation of computer precision. This calculator can only take up to 32 bit of binary value or up to 10 digit decimal values.

Binary calculation—add or subtract

    = ?

Convert Binary Value to Decimal Value

Binary Value: = ?

Convert Decimal Value to Binary Value

Decimal Value: = ?


References

The binary system is a numerical system that uses only two symbols, 0 and 1. Due to its ease of implementation in digital electronic circuitry using logic gates, all modern computers use the binary system internally.

The following are some typical conversions between binary values and decimal values.

    decimal 0 = 0 in binary
    decimal 1 = 1 in binary
    decimal 2 = 10 in binary
    decimal 3 = 2 + 1 = 11 in binary
    decimal 4 = 22 = 100 in binary
    decimal 7 = 22 + 2 + 1 = 111 in binary
    decimal 8 = 23 = 1000 in binary
    decimal 10 = 23 + 2 = 1010 in binary
    decimal 16 = 24 = 10000 in binary
    decimal 20 = 24 + 22 = 10100 in binary

Binary Addition
The addition of binaries is similar to the decimal system. The only different is to carry over when the result is 2.

    0 + 0 = 0
    0 + 1 = 1
    1 + 0 = 1
    1 + 1 = 0, carry 1 = 10

For example:

           0 1 1 0 1
    +     1 0 1 1 1
    ---------------------
    =  1 0 0 1 0 0

Binary Subtraction
Subtraction works similarly:

    0 - 0 = 0
    0 - 1 = 1, borrow 1 = -1
    1 - 0 = 1
    1 - 1 = 0

For example:

           1 0 1 1 1
    +     0 1 1 0 1
    ---------------------
    =     0 1 0 1 0