Binary Division Calculator – Free

This binary division calculator divides the first binary number by the second and shows the whole-number quotient in binary and decimal. Any remainder is discarded.

How to use the Binary Division Calculator tool

  1. Enter the dividend in the First binary number box.
  2. Enter the divisor in the Second binary number box. It must not be zero.
  3. Select Divide, or select Example to divide 1011 by 11.
  4. Read the quotient on the Binary and Decimal lines of the Result box.
  5. Select Copy to copy the quotient, or Clear to set up another division.

How binary division works

Binary long division uses the same steps as the decimal method taught in school, and it is simpler because each quotient digit is either 0 or 1. Bring down bits of the dividend from the left until the working value is at least as large as the divisor. Write 1 in the quotient and subtract the divisor. Otherwise write 0. Bring down the next bit and repeat.

There is no multiplication table to consult. At every step the only question is whether the divisor fits. This compare-and-subtract loop is also how simple processors without a divide instruction perform division in software.

Worked example: 110010 divided by 101

This is 50 divided by 5. The first three bits, 110, are at least 101, so the quotient starts with 1 and the remainder is 1. Bringing down 0 gives 10, which is too small: quotient bit 0. Bringing down 1 gives 101, which fits exactly: quotient bit 1, remainder 0. The last bit is 0 and gives a final quotient bit of 0.

110010 / 101

Binary: 1010
Decimal: 10

Integer quotient only

The result is a whole number. Fractions are not produced and the remainder is not shown. The page example, 1011 divided by 11, is 11 divided by 3 in decimal. It returns Binary: 11 and Decimal: 3, and the leftover 2 is dropped. To get that leftover, run the same inputs through the Binary Modulo Calculator.

With negative operands the quotient is truncated toward zero. Dividing -1011 by 11 returns -11, which is -3, not -4. This matches integer division in C, Java and JavaScript BigInt. Python's // operator rounds toward negative infinity and would give -4, so keep the difference in mind when checking code against this tool.

Dividing by powers of two

When the divisor is a 1 followed by zeros, division is a right shift. Dividing by 10 drops the last bit, dividing by 100 drops the last two, and so on. For example, 11100 divided by 100 is 111, which is 28 divided by 4. Compilers use this for unsigned values to replace division by a power of two with a shift, since shifts are much cheaper than a general divide.

Input rules and the zero divisor error

Both operands are binary whole numbers of up to 4,096 characters. A 0b prefix and a leading minus sign are accepted. Spaces inside a number are not. If the second number is zero in any form, such as 0, 000 or -0, the tool reports The divisor must be nonzero. A dividend smaller than the divisor is not an error and returns 0. A stray digit such as 2 returns Invalid base-2 digit with the character named. The calculation runs locally in your browser.

Frequently asked questions

How do I divide binary numbers by hand?

Use long division. Compare the divisor with the leading bits of the dividend, write 1 and subtract when it fits, write 0 when it does not, then bring down the next bit. Continue until every bit has been used.

Does the calculator show the remainder?

No. It returns only the integer quotient. Use the Binary Modulo Calculator with the same two numbers to get the remainder, then check that quotient times divisor plus remainder equals the dividend.

What happens when I divide by zero?

The calculation is refused and the status line reads The divisor must be nonzero. Division by zero has no defined result for integers, so no quotient is shown.

Can it return a binary fraction such as 1.1?

No. Only whole-number quotients are produced. Dividing 111 by 10, which is 7 by 2, returns 11, or 3. The half is discarded.

How are negative numbers divided?

The sign is applied to a truncated quotient. Dividing -111 by 10 gives -11, which is -3, because the exact answer -3.5 is cut toward zero. The tool uses a minus sign and does not use two's complement.

Related tools