Divide two binary numbers exactly, returning the integer quotient and the remainder separately – the form long division and hardware dividers actually produce.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Quotient and remainder, both binary
Integer division answers two questions — how many times, and what is left — and this calculator reports both in binary. The algorithm is decimal long division with a binary alphabet: at each step the divisor either fits (write 1, subtract) or does not (write 0), then bring down the next bit.
Division by zero is rejected with a plain statement of undefinedness — the same condition that raises exceptions in hardware.
Worked example
100011 ÷ 101 (35 ÷ 5) 101 into 100 → no → 0 101 into 1000 → yes → 1, remainder 11 101 into 111 → yes → 1, remainder 10 101 into 101 → yes → 1, remainder 0 Quotient: 111 (7) Remainder: 0 ✓
Remainder = modulo
For non-negative operands the remainder IS the % operator’s answer: masks, ring buffers and hash-bucket maths all consume it. Language conventions vary for negatives — worth checking per language rather than assuming; the calculator states the mathematical pair.
Powers of two, the shortcut
Dividing by 2ⁿ is a right shift by n, remainder = the shifted-out bits. Seeing that here — divide anything by 100₂ and watch two bits drop into the remainder — cements why shifts and masks replace division in fast paths.
Privacy
Long division runs locally; dividends never leave the page.
How to use the Binary Division Calculator
- Enter dividend and divisor.
- Click "Divide".
- You get the integer quotient AND the remainder, both in binary.
- Division by zero is rejected with a clear message.
Frequently asked questions
Why does the result have two parts?
Integer division produces quotient and remainder: 100011 ÷ 101 = 111 remainder 0 (35 ÷ 5 = 7 r 0). Presenting both matches long division, hardware dividers and the % operator – the remainder is not an error, it is half the answer.
How does binary long division proceed?
Exactly like decimal long division but each quotient digit is only 0 or 1: does the divisor fit into the current prefix? If yes write 1 and subtract, else write 0 – then bring down the next bit.
What is the relationship to modulo?
The remainder IS the modulo for positive operands: 100011 mod 101 = 0 here. Programming languages differ on negative-operand conventions, which is worth checking per language.
Can the divisor be larger than the dividend?
Yes – the quotient is simply 0 and the remainder is the whole dividend: 101 ÷ 100011 = 0 r 101. Nothing special happens.
Why is division by zero rejected rather than infinity?
Integer division by zero is undefined – there is no integer q with q×0 = dividend (unless dividend is 0, and then every q works). The error message states it plainly; CPUs raise an exception for the same reason.
Does this handle enormous dividends?
Yes – BigInt long division is exact at any length, e.g. an 80-bit dividend against a 7-bit divisor.
Is the division carried out locally?
Yes – quotient and remainder are computed in-page.