Binary Calculator

In short: binary arithmetic with the training wheels visible: 101101 + 1101 = 111010, which is 45 + 13 = 58 in decimal. The calculator adds, subtracts, multiplies and divides in base 2, runs the bitwise AND, OR and XOR operations, shows every result in decimal and hex as well, and can display the two's complement of the first number at any width.

Adding and subtracting in base 2

Binary addition follows the same column method as decimal, with a much smaller rulebook: 0 + 0 = 0, 1 + 0 = 1, 1 + 1 = 10 (write 0, carry 1), and 1 + 1 + 1 = 11 (write 1, carry 1). Worked through the default example: 101101 + 1101. Align the right edges, and from the right: 1+1 = 10, write 0 carry 1; 0+0+carry = 1; 1+1 = 10, write 0 carry 1; 1+1+carry = 11, write 1 carry 1; 0+carry = 1; the final 1 stands. Result: 111010 — and the decimal check confirms it, 45 + 13 = 58. Multiplication is shift-and-add, exactly as computers do it: for each 1 in the multiplier, add a shifted copy of the other number. 1111 x 101 = 1111 + 111100 = 1001011, which is 15 x 5 = 75.

Subtraction in real hardware is never done by borrowing. Computers add the two's complement instead: flip every bit of the number being subtracted and add 1, then add. The two's complement of 25 (00011001 in 8 bits) is 11100111 — flip to 11100110, add 1 — and that pattern, read as a signed 8-bit number, is -25. Adding it to another number subtracts 25, and any carry out of the top bit is simply discarded. Enter a width at the top of the calculator and it shows the two's complement of your first number, which is the single most useful idea in how machines represent negative numbers.

The bitwise operations

AND, OR and XOR compare two numbers bit by bit, position by position, with no carries. AND returns 1 only where both bits are 1 — used to mask off bits you do not care about: any number AND 00001111 keeps only its lowest four bits. OR returns 1 where either bit is 1 — used to switch selected bits on. XOR returns 1 where the bits differ — used to toggle bits, and at the heart of checksums, parity and simple encryption. Try 101101 against 1101 (padded to 001101): AND gives 000101, OR gives 101101, XOR gives 100000. Programmers reach for these daily; permissions flags, network masks and graphics code are all built from them.

Division returns a quotient and a remainder, as integer division does in most programming languages: 101101 / 1101 is 11 remainder 10 (45 / 13 = 3 remainder 6). The calculator shows both. If you need fractions, the binary point works like the decimal point — bits to the right are worth 1/2, 1/4, 1/8 — but this page keeps to whole numbers, which is what bitwise and systems work almost always uses.

Reading the other bases

Every result is also shown in decimal and hexadecimal, because the three bases are one number in three costumes and fluency is switching at sight. Hex groups binary into fours: 111010 splits as 0011 1010, which is 3A — two hex digits replacing six bits, which is why memory dumps and colour codes use it. To check any conversion by hand, use place value: each binary digit is worth double the one to its right, so 111010 = 32 + 16 + 8 + 0 + 2 + 0 = 58. The companion binary converter on this site handles decimal-to-binary and text-to-binary in both directions; this page is for operating on the numbers once they are in base 2.

Frequently asked questions

How do you add binary numbers?

Column by column from the right, with carries: 0 + 0 = 0, 1 + 0 = 1, 1 + 1 = 10 (write 0, carry 1), and 1 + 1 plus a carried 1 = 11 (write 1, carry 1). For example 101101 + 1101: the columns give 111010. Check in decimal whenever you are learning: 101101 is 45, 1101 is 13, and 45 + 13 = 58, which is 111010. If the decimal check fails, a carry was dropped.

What is two's complement?

The standard way computers store negative integers. To negate a number at a fixed width: flip every bit, then add 1. In 8 bits, 25 is 00011001; flipped it is 11100110; plus 1 gives 11100111, which read as a signed 8-bit value is -25. The payoff is that one adder circuit then handles both addition and subtraction, and zero has a single representation. The width matters: the same pattern means different values at 8, 16 or 32 bits.

What is the difference between AND, OR and XOR?

They compare bits position by position. AND gives 1 only when both bits are 1 — used for masking. OR gives 1 when at least one bit is 1 — used for setting flags. XOR gives 1 when the bits differ — used for toggling and parity. On 101101 and 001101: AND = 000101, OR = 101101, XOR = 100000. None of them carries between positions, which is what makes them "bitwise" rather than arithmetic.

How do I convert the result to decimal or hex?

For decimal, add the place values of the 1 bits: each position is worth double the one to its right, starting at 1. 111010 = 32 + 16 + 8 + 2 = 58. For hex, group the bits in fours from the right and convert each group: 0011 1010 becomes 3 and A, so 3A. The calculator prints both conversions under every result so you can check your own working against them.

Why does division show a remainder instead of decimals?

Because binary arithmetic in hardware and in most programming languages is integer arithmetic: the quotient is whole and the leftover is the remainder. 101101 / 1101 is 11 remainder 10 (45 / 13 = 3 remainder 6). Fractions need a binary point — bits worth 1/2, 1/4, 1/8 to its right — and most systems work (bit masks, addresses, permissions) is whole-number work, so this calculator keeps the exact integer answer.

Related tools

Examples checked on 24 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.