Binary Calculator
Add, subtract, multiply and divide binary numbers of any length (up to 64 bits each), with the result in binary, decimal and hex, the remainder for division, and the decimal check.
How it works
Addition: 0+0 = 0, 0+1 = 1, 1+1 = 10 (write 0, carry 1), 1+1+1 = 11 · Subtraction: borrow 1 from the next column = 2 · Multiplication: shift-and-add partial products (1 × 1 = 1, otherwise 0) · Division: long division, the quotient bit is 1 whenever the divisor fits
Binary arithmetic follows the same column rules as decimal, but each column can only hold 0 or 1, so 1 + 1 carries into the next column. The calculator works with exact big integers, so 64-bit operands and their products never lose precision, and shows the answer in binary, decimal and hexadecimal so you can check homework or debug low-level code. Division gives the integer quotient and remainder, as in integer division in programming languages.
Worked example
101101 + 1011: in decimal that is 45 + 11 = 56. Column by column from the right: 1+1 = 10 (0, carry 1), 0+1+1 = 10 (0, carry 1), 1+0+1 = 10 (0, carry 1), 1+1+1 = 11 (1, carry 1), 0+1 = 1, 1 = 1 → 111000 (0x38).
Sources: Binary number — arithmetic (Wikipedia) · Khan Academy — Adding in binary
Frequently asked questions
How do you add binary numbers?
Line them up on the right and add column by column: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 0 with a carry of 1, and 1 + 1 + 1 (with a carry) = 1 with a carry of 1. Continue to the leftmost column and write any final carry.
How does binary subtraction with borrowing work?
When you need to take 1 from 0, borrow from the next column to the left: the 0 becomes 10 (two), and 10 − 1 = 1. Computers instead add the two’s complement of the second number, which gives the same result.
How do I multiply binary numbers?
For each 1 in the second number, write the first number shifted left by that bit’s position, then add the partial products. 101 × 11 = 101 + 1010 = 1111 (5 × 3 = 15).
What happens with negative results?
The calculator shows them with a minus sign (−101 = −5). In a fixed-width register the same value would be stored in two’s complement — use the two’s complement calculator to see that bit pattern.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.