Binary Calculator

Enter two binary numbers and choose an operation.

Operation

AND, OR and XOR compare the numbers digit by digit.

Only the digits 0 and 1; a leading minus sign is allowed.

Only the digits 0 and 1; a leading minus sign is allowed.

Try

Result

You entered10112 ÷ 1102\mathrm{1011}_{2}\ \div\ \mathrm{110}_{2}

10112 ÷ 1102=12 remainder 1012\displaystyle \mathrm{1011}_{2}\ \div\ \mathrm{110}_{2} = \mathrm{1}_{2}\ \text{remainder}\ \mathrm{101}_{2}

Decimal

11÷6=1 remainder 5\displaystyle 11 \div 6 = 1\ \text{remainder}\ 5

Hex

116 remainder 516\displaystyle \mathrm{1}_{16}\ \text{remainder}\ \mathrm{5}_{16}
Show the work
  1. Binary to decimal

    Each binary digit is worth a power of 22, counting from 00 at the right. Converting both numbers to decimal lets the operation be done with ordinary arithmetic.

    Using N=dk 2k+⋯+d1 2+d0N = d_{k}\,2^{k} + \cdots + d_{1}\,2 + d_{0}

    10112=1×23+0×22+1×21+1×20=8+0+2+1=111102=1×22+1×21+0×20=4+2+0=6\begin{gathered} \mathrm{1011}_{2} = 1 \times 2^{3} + 0 \times 2^{2} + 1 \times 2^{1} + 1 \times 2^{0} = 8 + 0 + 2 + 1 = 11 \\ \mathrm{110}_{2} = 1 \times 2^{2} + 1 \times 2^{1} + 0 \times 2^{0} = 4 + 2 + 0 = 6 \end{gathered}
  2. Division with a remainder

    Dividing a=11a = 11 by b=6b = 6 gives a whole-number quotient qq and a remainder rr that is smaller than the divisor in size.

    Using a=b×q+ra = b \times q + r

    11=6×1+511 = 6 \times 1 + 5
  3. Decimal to binary

    Write the quotient and the remainder in binary.

    1=125=1012\begin{gathered} 1 = \mathrm{1}_{2} \\ 5 = \mathrm{101}_{2} \end{gathered}
  4. Result

    So 10112 ÷ 1102\mathrm{1011}_{2}\ \div\ \mathrm{110}_{2} gives quotient 12\mathrm{1}_{2} and remainder 1012\mathrm{101}_{2}.

Worked examples

10112 + 1102\mathrm{1011}_{2}\ +\ \mathrm{110}_{2}
10112 + 1102=100012\mathrm{1011}_{2}\ +\ \mathrm{110}_{2} = \mathrm{10001}_{2}

Binary addition with carries, Check in decimal

10112 − 1102\mathrm{1011}_{2}\ -\ \mathrm{110}_{2}
10112 − 1102=1012\mathrm{1011}_{2}\ -\ \mathrm{110}_{2} = \mathrm{101}_{2}

Binary to decimal, Subtraction in decimal

1102 − 10112\mathrm{110}_{2}\ -\ \mathrm{1011}_{2}
1102 − 10112=−1012\mathrm{110}_{2}\ -\ \mathrm{1011}_{2} = -\mathrm{101}_{2}

Binary to decimal, Subtraction in decimal

10112 × 1102\mathrm{1011}_{2}\ \times\ \mathrm{110}_{2}
10112 × 1102=10000102\mathrm{1011}_{2}\ \times\ \mathrm{110}_{2} = \mathrm{1000010}_{2}

Binary to decimal, Multiplication in decimal

10112 ÷ 1102\mathrm{1011}_{2}\ \div\ \mathrm{110}_{2}
10112 ÷ 1102=12 remainder 1012\mathrm{1011}_{2}\ \div\ \mathrm{110}_{2} = \mathrm{1}_{2}\ \text{remainder}\ \mathrm{101}_{2}

Binary to decimal, Division with a remainder

10112 AND 1102\mathrm{1011}_{2}\ \mathrm{AND}\ \mathrm{110}_{2}
10112 AND 1102=102\mathrm{1011}_{2}\ \mathrm{AND}\ \mathrm{110}_{2} = \mathrm{10}_{2}

Binary to decimal, Bitwise AND

10112 OR 1102\mathrm{1011}_{2}\ \mathrm{OR}\ \mathrm{110}_{2}
10112 OR 1102=11112\mathrm{1011}_{2}\ \mathrm{OR}\ \mathrm{110}_{2} = \mathrm{1111}_{2}

Binary to decimal, Bitwise OR

10112 XOR 1102\mathrm{1011}_{2}\ \mathrm{XOR}\ \mathrm{110}_{2}
10112 XOR 1102=11012\mathrm{1011}_{2}\ \mathrm{XOR}\ \mathrm{110}_{2} = \mathrm{1101}_{2}

Binary to decimal, Bitwise XOR