Binary Calculator
Enter two binary numbers and choose an operation. The result appears instantly in binary, decimal, hex and octal.
- + − × ÷ mod
- AND · OR · XOR · NOT
- Bit shifts
- Results in 4 bases
What is a binary calculator?
A binary calculator performs arithmetic and logic directly on base-2 numbers. You can add, subtract, multiply and divide binary values, find the remainder, and apply the bitwise operations programmers use every day: AND, OR, XOR, NOT and shifts. Results are shown in binary alongside decimal, hex and octal, so you can check your work or translate it for code. Switch the input base to work in octal, decimal or hex instead.
How to use the binary calculator
- Enter the first binary number in A and the second in B.
- Choose an operation: + − × ÷ mod, AND, OR, XOR, NOT or a shift.
- Read the result in binary, decimal, hex and octal. Division also shows the remainder.
- Change the number base to work in hex, octal or decimal; your numbers are converted for you.
Bitwise operations at a glance
- AND: 1 only where both bits are 1. 1100 AND 1010 = 1000.
- OR: 1 where either bit is 1. 1100 OR 1010 = 1110.
- XOR: 1 where the bits differ. 1100 XOR 1010 = 0110.
- NOT flips every bit within the chosen width. Shift left (<<) by n multiplies by 2ⁿ; shift right (>>) divides by 2ⁿ, rounding down.
Why use this binary calculator
- Every operation in one placeArithmetic, bitwise logic and shifts, without switching tools.
- Results in every baseSee the answer in binary, octal, decimal and hex at once.
- No overflowArbitrary-precision integers, so large results are exact.
- Private by designEverything is calculated in your browser. Nothing you type is sent to a server or saved.
Common uses
- Homework. Check binary addition with carries and subtraction with borrows.
- Bit masks. Combine and clear flags with AND, OR and XOR.
- Digital logic. Verify gate and ALU behaviour.
- Interview practice. Test bit-manipulation tricks.
Related converters: number base converter, hex to decimal, decimal to hex, binary to decimal, decimal to binary, hex to binary, binary to hex, hex calculator. Browse all encoding tools.
Example: binary addition
1011 (11) + 110 (6) = 10001 (17) In hex: B + 6 = 11
What to expect from the result
Integers only; division rounds toward zero and shows the remainder. NOT uses the bit width you choose (8–64 bits). Negative results are shown with a minus sign rather than as two’s complement; use the number base converter to see the bit pattern.
Binary Calculator questions
How do you add binary numbers?
Add column by column from the right: 0+0 = 0, 0+1 = 1, 1+1 = 0 carry 1, 1+1+1 = 1 carry 1. 1011 + 110 = 10001.
How do you subtract binary numbers?
Subtract column by column, borrowing 2 from the next column when needed. The calculator shows the answer instantly, including negative results.
What is XOR in binary?
XOR (exclusive or) gives 1 where the bits are different and 0 where they are the same. 1100 XOR 1010 = 0110.
How does binary division work?
Like long division in base 10, using only 0 and 1. This calculator returns the whole-number quotient and the remainder.
Can I use hex instead of binary?
Yes. Change the number base to hexadecimal, or use the hex calculator.