HomeMathBinary Calculator

Last updated: Nov 18, 2026

Binary Calculator

Twelve independent binary tools with exact BigInt arithmetic, signed and unsigned bit widths, bitwise logic, conversions, IEEE-754 fractions, Hamming codes and IPv4 masks. Each card calculates on its own and passes its result to the next card as a suggested input. Last updated 18 November 2026. Every result is cross-checked in decimal.

Binary Calculator: Add, Subtract, Multiply & Divide Binary Numbers (With Steps)

A binary calculator does math on numbers made only of 0s and 1s. Enter two binary values, pick an operation, and the tool shows the answer in binary, decimal, hex and octal.

This free binary calculator has 12 cards. They cover add, subtract, multiply, divide, modulo, AND, OR, XOR, shifts, two’s complement, overflow, binary fractions, ASCII, Hamming codes and IPv4 masks. Every card runs on its own, and each checks its answer against decimal.

It suits students learning base 2, programmers working with bit masks, and networking and electronics learners. Anyone who wants a binary math calculator that shows its work can use it too.

Binary matters because every computer stores data as bits. One wrong carry, one wrong bit width or one lost sign bit changes the whole answer.

Quick facts

  • Input rules: Digits must be 0 or 1. You may type a 0b prefix, spaces, commas or underscores.
  • Bases: Cards that accept a base support bases 2 to 36.
  • Output: Binary, decimal, hex and octal, with a decimal cross-check.
  • Bit widths: Signed and unsigned results work from 1 to 1,024 bits, depending on the card.

How to Use the Binary Calculator

You can use any card in under a minute.

  1. Choose a card. Card 1 covers everyday binary arithmetic. Later cards handle bitwise logic, signed numbers and more.
  2. Type your values. Fields default to base 2. Change the base menu to enter decimal, hex or any base up to 36.
  3. Pick an operation and a bit width. Leave the width on “Auto” when you only want the exact answer.
  4. Click Calculate. Click Fill Example to load sample numbers. Click Reset to clear the card.
  5. Read the results. Compare the binary answer with the decimal cross-check. They must match.
  6. Chain the cards. A result fills the next card and is marked “Auto-filled.” Type your own value to override it.

If you see an “Invalid digit” message, a character is not allowed in that base. In base 2, the digits 2 to 9 are errors.

What Each of the 12 Cards Does

#CardInputsMain results
1Binary ArithmeticValue A, Base of A, Value B, Base of B, Operation, Output baseBinary result, chosen base, decimal cross-check, hex/octal, bit count, parity
2Bitwise Logic LabBinary A, Binary B, Bit width, OperationResult at set width, Hamming distance, Jaccard similarity, shared set bits
3Two’s ComplementValue, Base, Bit widthStored pattern, signed/unsigned reading, one’s complement, signed range
4Number Base ConverterNumber, From base, To base, Group sizeBinary, octal, decimal, hex, bits and bytes
5Bit Shift and RotateBinary value, Width, Shift amount, OperationResult, bits shifted out, equivalent math, overflow flag
6Bit Width and OverflowValue A, Value B, Base, Operation, Width, Signed or unsignedExact result, wrapped result, valid range, headroom
7Binary Long DivisionDividend, Divisor, Fraction bitsQuotient, remainder, divisibility, division steps
8Binary Fractions and IEEE-754Value, Direction, Max fraction bitsDecimal/binary/hex value, approximation error, float32 encoding
9Binary to Text and ASCIIText or binary, Direction, Bits per byte, SeparatorHex bytes, decimal codes, total bits, parity
10Hamming CodeData bits, Parity type, Flip positionParity bits, overhead, received word, syndrome
11IPv4 and CIDR MaskIPv4 address, Prefix lengthBinary address, mask, network/broadcast, usable hosts
12Number Properties and Gray CodeValue, Base, Bit width, Gray bitsPopulation count, leading/trailing zeros, power-of-two test, Gray code

Formulas the calculator uses

  • Arithmetic: Result = A op B, computed with arbitrary-precision integers. That is why large binary numbers do not lose digits.
  • Place value: Value = sum of (digit × base^position).
  • Two’s complement: Stored pattern = value mod 2^N. Signed range = −2^(N−1) to 2^(N−1) − 1.
  • Shifts: Left shift by n multiplies by 2^n. Logical right shift divides by 2^n and rounds down.
  • Division: For each bit, remainder = 2 × remainder + bit. Then dividend = quotient × divisor + remainder.
  • Gray code: n XOR (n >> 1).
  • IPv4: Network = IP AND mask. Usable hosts = 2^(32 − prefix) − 2.

Assumptions and limits

  • Card 1 integer division drops the remainder. Use Card 7 when you need the remainder or fraction bits.
  • Card 1 accepts powers with exponents from 0 to 2000. Division and modulo by zero return an error.
  • Card 2 accepts only non-negative inputs. Use Card 3 for signed values.
  • Card 10 accepts 1 to 57 data bits and corrects a single flipped bit.
  • Card 8 rounds to the bits you allow, so many decimals show an approximation error.
  • The calculator code runs in your browser and makes no network requests with your numbers. Like most sites, intelcalculator.com may use ads and analytics. See the privacy policy.
  • Use results for learning and checking. For safety-critical hardware or code, confirm them in your own toolchain.

What to Look for in a Binary Calculator

If you are comparing the best binary calculator options, five features separate a toy from a real tool.

FeatureWhy it mattersIn this tool
Full operation setLearners and coders both need more than add and subtractYes: + − × ÷, mod, power, AND, OR, XOR, shifts
Bit width and signed modeWithout them, negatives and overflow are wrongYes: Cards 3, 5, 6
RemaindersDivision rarely comes out evenYes: Card 7
Steps and checksYou learn only if you see the workPartly: division steps, bit matrix, decimal check
Large numbersProgrammers use 64-bit and wider valuesYes: arbitrary precision

Binary Place Values and Conversion

Binary is base 2. Each position is worth twice the position to its right. The base is also called the radix.

Position76543210
Value1286432168421

To read 101101, add the place values where a 1 appears: 32 + 8 + 4 + 1 = 45. To go the other way, subtract the biggest power of two that fits, then repeat.

You can do both steps in Card 4, our number base converter. For practice numbers, use the random number generator.

Reference table: 0 to 31

DecBinHexDecBinHex
0000000161000010
1000011171000111
2000102181001012
3000113191001113
4001004201010014
5001015211010115
6001106221011016
7001117231011117
8010008241100018
9010019251100119
1001010A26110101A
1101011B27110111B
1201100C28111001C
1301101D29111011D
1401110E30111101E
1501111F31111111F

Binary, octal, decimal and hex compared

Hex and octal exist because they are short ways to write long bit strings. One hex digit equals four bits, called a nibble. One octal digit equals three bits.

SystemBaseDigitsBits per digit45 written asTypical use
Binary20–11101101Hardware, logic
Octal80–7355Unix file permissions
Decimal100–9n/a45Everyday math
Hexadecimal160–9, A–F42DMemory, colors, debugging

German mathematician Gottfried Leibniz described modern binary arithmetic in 1703. Computers adopted it because two states, on and off, are easy to build reliably.

Binary Addition

Binary addition follows five rules. This is the core of any binary addition calculator.

SumResultCarry
0 + 000
0 + 110
1 + 010
1 + 101
1 + 1 + 111

Example 1: 1011 + 1101

carry:   1 1 1 1
           1 0 1 1
       +   1 1 0 1
         ---------
         1 1 0 0 0

Work from the right. 1 + 1 = 10, so write 0 and carry 1. The carry keeps moving left until the final carry becomes the leading 1.

Decimal check:11 + 13 = 24, and 11000 = 16 + 8 = 24.

Example 2: 110101 + 100110 = 1011011. In decimal, 53 + 38 = 91, and 1011011 = 64 + 16 + 8 + 2 + 1 = 91. This is the default example in Card 1.

If you want to add binary numbers fast, line up the digits on the right. Then add one column at a time.

Binary Subtraction

Binary subtraction uses borrowing. If you subtract 1 from 0, borrow 1 from the next column to the left. That borrowed 1 is worth 2, so 10 − 1 = 1.

Example 1: 11010 − 1011 = 1111. In decimal, 26 − 11 = 15. A binary subtraction calculator should confirm 1111 = 15.

Example 2: 101 − 1001 (a negative result). Subtract the smaller from the larger: 1001 − 101 = 100. Put a minus sign in front, so the answer is −100, or −4 in decimal.

Computers do not store a minus sign. In 8-bit two’s complement, −4 is stored as 11111100. We cover this method in the next sections.

Binary Multiplication

Multiplying binary numbers is simpler than decimal. Each digit of the second number is either 0 or 1, so each partial product is either zero or a copy of the first number.

Example 1: 1101 × 101

  • The rightmost 1 gives 1101.
  • The middle 0 gives 0000.
  • The left 1 gives 1101 shifted two places, which is 110100.
  • Add them: 1101 + 110100 = 1000001.

Decimal check: 13 × 5 = 65, and 1000001 = 64 + 1 = 65.

Example 2: 110 × 11 = 10010. The partial products are 110 and 1100. They add to 10010, and 6 × 3 = 18.

Binary Division

Binary division works like long division. At each step you ask if the divisor fits into the running remainder. If it does, write 1 in the quotient and subtract. If not, write 0.

Example with a remainder: 110101 ÷ 101

  • The quotient is 1010 (decimal 10).
  • The remainder is 11 (decimal 3).
  • Check: 1010 × 101 = 110010 (50), and 50 + 3 = 53 = 110101. ✔

The rule to remember is dividend = quotient × divisor + remainder.

You can also keep dividing past the binary point. With 4 fraction bits, 53 ÷ 5 becomes 1010.1001, which is 10.5625. The true value is 10.6, so the gap of 0.0375 is the approximation error.

Dividing by zero has no answer. The calculator shows “Cannot divide by zero.” Try the remainder calculator for decimal remainders, or the integer calculator for whole-number work.

Card 1 also offers modulo, power, greatest common divisor and least common multiple. See the GCF calculator and LCM calculator for the decimal versions.

Bitwise Operations: AND, OR, XOR, NOT and Shifts

Bitwise operations compare two numbers one bit at a time. Programmers use them for flags, masks and permissions. If you are looking for a bitwise calculator, Card 2 handles these operations.

ABANDORXORNANDNORXNOR
00000111
01011100
10011100
11110001

Example: A = 11110000, B = 10101010 at 8 bits

  • AND = 10100000
  • OR = 11111010
  • XOR = 01011010

NOT flips every bit. At 8 bits, NOT 10101010 gives 01010101. Card 3 shows this as the one’s complement, and Card 2 gives the same result as XOR with all ones.

Left shift and right shift

A shift slides every bit sideways. This calculator works as a left shift right shift calculator through Card 5.

Example: 10110011 at 8 bits, shifted by 3

  • Logical left shift (<<) gives 10011000. The bits 101 fall off the left end.
  • Logical right shift (>>>), also called the zero-fill right shift, gives 00010110.
  • Arithmetic right shift (>>) by 2 gives 11101100. It copies the sign bit, so −77 becomes −20.

Left shift by n multiplies by 2^n. Right shift divides by 2^n and rounds down. A rotate moves the lost bits to the other end instead of dropping them.

Negative Numbers and Two’s Complement

Computers store negative numbers with two’s complement. The top bit acts as the sign, and the same bits can mean different numbers.

How to find −45 in 8 bits

  1. Write 45 in binary: 00101101.
  2. Flip every bit: 11010010.
  3. Add 1: 11010011.

The result is 0xD3. Read as unsigned, those bits equal 211. Read as signed, they equal −45.

Signed vs unsigned

BitsUnsigned rangeSigned rangeTotal values
40 to 15−8 to 716
80 to 255−128 to 127256
160 to 65,535−32,768 to 32,76765,536
320 to 4,294,967,295−2,147,483,648 to 2,147,483,6474,294,967,296
640 to 18,446,744,073,709,551,615−9,223,372,036,854,775,808 to 9,223,372,036,854,775,80718,446,744,073,709,551,616

All values come from 2^N − 1 and −2^(N−1) to 2^(N−1) − 1. Our two’s complement calculator has a dedicated page for this method. Use the absolute value calculator when you only need a number’s size.

Pro tip: Always choose signed or unsigned before you read a result. The pattern 11111111 is 255 unsigned and −1 signed.

2-twos-complement-negative-45

Binary Overflow and Wrap-Around

Binary overflow happens when the exact answer needs more bits than you have. The stored result wraps around, which is why this is also called n-bit wrap.

Two examples at 8 bits

  • Unsigned: 200 + 100 = 300. The stored answer is 300 mod 256 = 44, or 00101100.
  • Signed: 127 + 1 = 128. The stored answer is −128, or 10000000.

Card 6 shows the exact result, the wrapped result, the valid range and the headroom left. We ran a small experiment to see how common overflow is. We tested every possible pair of values at two sizes.

TestPairs testedPairs that overflowShare
4-bit unsigned add25612046.9%
4-bit signed add2566425.0%
8-bit unsigned add65,53632,64049.8%
8-bit signed add65,53616,38425.0%
8-bit unsigned multiply65,53663,56897.0%

Unsigned addition overflows for nearly half of all pairs. Signed addition overflows for exactly a quarter. Multiplication overflows far more often, because products grow quickly.

Overflow is a real engineering risk. The 1996 Ariane 5 Flight 501 failure traced to a 64-bit float converted into a 16-bit signed integer that was too small. Many systems that count seconds in a 32-bit signed integer reach their limit of 2,147,483,647 on January 19, 2038.

Bar chart of binary overflow rates: signed add 25%, unsigned add about 47–50%, 8-bit unsigned multiply 97%

Binary Fractions and Floating Point

Fractions use weights of 1/2, 1/4, 1/8 and so on. For example, 1011.101 = 8 + 2 + 1 + 0.5 + 0.125 = 11.625.

Many decimals cannot be written exactly. Decimal 0.1 repeats forever in binary, starting 0.0001100110011. A 32-bit float stores it as 0x3DCCCCCD, which is about 0.10000000149.

Card 8 shows this approximation error and the IEEE 754 float32 encoding. For very large or small decimals, try the scientific notation calculator or the decimal calculator.

Real-World Uses of Binary Math

Text and ASCII. Each character becomes one or more bytes. “Hi!” is 01001000 01101001 00100001 in 8-bit form. ASCII uses 7 bits per character, and UTF-8 uses 8 bits or more. Plain ASCII was standardized in 1963.

IPv4 and subnets. A mask sets the first N bits to 1. For 192.168.10.37 with a /24 prefix, the mask is 255.255.255.0 and the network is 192.168.10.0. The broadcast address is 192.168.10.255, and there are 254 usable hosts. For 10.20.30.40 at /19, the network is 10.20.0.0 and there are 8,190 usable hosts. Use the kilobytes to megabytes converter for data-size questions.

Error correction. Richard Hamming described his codes in 1950. They add parity bits at positions 1, 2, 4, 8 and so on. The syndrome points to the flipped bit.

Data bitsParity bitsCodewordOverhead
43742.9%
841233.3%
1141526.7%
2653116.1%
576639.5%

Longer messages waste less space on parity.

Gray code. Gray code changes only one bit between neighbors. The first values for 4 bits are 0000, 0001, 0011, 0010, 0110. Engineers use it in rotary encoders to avoid false readings.

File permissions. The Unix mode 755 is 111 101 101 in binary. Each triplet sets read, write and execute bits.

Common Mistakes in Binary Math

Most wrong answers come from a few repeat errors. These are the common binary mistakes to avoid.

  • Typing a digit that is not 0 or 1. The calculator flags it as an invalid digit.
  • Forgetting the carry. 1 + 1 is 10, not 2.
  • Breaking the borrow chain. Borrow from the nearest 1 and pass the 2 down column by column.
  • Using the wrong bit width. An 8-bit answer can hide a 9th bit.
  • Mixing signed and unsigned. The same bits can mean 211 or −45.
  • Dropping the remainder. Integer division throws it away. Use Card 7 to keep it.
  • Trimming leading zeros too early. Zeros matter when you set a bit width.

Binary Practice Problems with Answers

Try these by hand, then check them with the calculator. These binary practice problems start easy and end with overflow.

  1. 1010 + 0111
  2. 10110 − 01101
  3. 1011 × 11
  4. 11110 ÷ 100 (give quotient and remainder)
  5. Convert 101101 to decimal.
  6. Convert decimal 37 to binary.
  7. Find 1100 AND 1010, 1100 OR 1010 and 1100 XOR 1010.
  8. Write −6 as an 8-bit two’s complement number.
  9. Shift 00001011 left by 2 at 8 bits.
  10. What happens when you add 1111 + 1 in 4-bit unsigned math?

Answers

#AnswerCheck
11000110 + 7 = 17
2100122 − 13 = 9
310000111 × 3 = 33
4Quotient 111, remainder 1030 = 7 × 4 + 2
54532 + 8 + 4 + 1
610010132 + 4 + 1 = 37
71000, 1110, 0110Bit by bit
811111010256 − 6 = 250
90010110011 × 4 = 44
10Exact 10000; stored 0000 with overflow15 + 1 = 16

Pro Tips From Our Review Process

  • Check every answer against decimal. A mismatch means a typo or a wrong width.
  • Group digits in fours. 1011 0111 is easier to read than 10110111.
  • Convert to hex when a binary string gets long.
  • Set the bit width first when you work with negative numbers.
  • Use Card 6 before you trust a calculation that must fit a register.
  • Re-run a hand calculation as a binary solver check. If the tool and your work disagree, find the column where they split.

Binary Calculator FAQ

What is a binary calculator?

A binary calculator is a tool that does math on base 2 numbers. It adds, subtracts, multiplies and divides, and often runs bitwise operations too. It shows the result in binary, decimal, hex and octal.

How do you add binary numbers?

Line up the digits and add column by column from the right. Use 0 + 0 = 0, 0 + 1 = 1 and 1 + 1 = 10, which means write 0 and carry 1. For example, 1011 + 1101 = 11000.

How do you subtract binary numbers with borrow?

Subtract column by column from the right. When you need 1 from a 0, borrow from the next 1 on the left. The borrowed 1 is worth 2 in the current column.

How do you multiply or divide in binary?

For multiplication, copy the top number for each 1 in the bottom number, shifting left each time, then add. For division, use long division: if the divisor fits, write 1 and subtract, otherwise write 0.

Can a binary calculator handle negative numbers?

Yes. Enter a minus sign for arithmetic, or use signed mode with a bit width. Computers store negatives in two’s complement, so −45 at 8 bits becomes 11010011.

How do you convert decimal to binary?

Divide the number by 2 and note the remainder, then repeat with the quotient until it reaches 0. Read the remainders from bottom to top. For 37, the result is 100101.

How accurate is a binary calculator?

Integer results are exact, because Card 1 uses arbitrary-precision integers and checks the answer in decimal. Fractions can show small rounding errors, since many decimals cannot be stored exactly in binary.

Why do hex and octal exist if computers only use binary?

They are shortcuts for humans. One hex digit stands for four bits and one octal digit for three bits. This makes long bit strings much easier to read and write.

What is 1 + 1 in binary?

It is 10, which is read “one zero” and equals 2 in decimal. The 0 is the sum digit and the 1 is the carry.

What happens if a binary result is larger than the bit width?

The result overflows and wraps around. At 8 bits unsigned, 200 + 100 becomes 44. At 8 bits signed, 127 + 1 becomes −128.

What is the remainder in binary division?

It is what is left after the divisor fits as many times as possible. In 110101 ÷ 101, the quotient is 1010 and the remainder is 11.

Conclusion

Binary math is simple once you know the rules. Carries, borrows, partial products and remainders follow the same logic as decimal math, just with two digits.

The details that cause errors are bit width, signed and unsigned reading, and overflow. This calculator handles all three, and it checks every result against decimal.

Use it to learn the method, to verify homework or code, or to work with large numbers that break other tools. Pick a card above, load an example and see the answer.

Related Calculators