How-toMath & conversion4 min read

How to Use a Binary Calculator: Arithmetic, Bitwise Logic and Word Size

What a binary calculator does, how to enter values, and how to read the result, overflow and two's complement output.

SH

Founder, CalculatePilot

On this pageexpand_more
How to use a binary calculator
lightbulb

Short answer

A binary calculator works on base-2 numbers inside a fixed register of 8, 16, 32 or 64 bits. Enter two binary operands, choose an operation, and read the result in binary, decimal and hex. A result too big for the register overflows and is truncated.

1. Step by step

  1. 1Pick a word size: 8, 16, 32 or 64 bits.
  2. 2Enter operand A and operand B using only 0 and 1.
  3. 3Choose an operation: add, subtract, multiply, divide, a bitwise gate (AND, OR, XOR, NOT, NAND, NOR), a shift or rotate, or two's complement.
  4. 4Read the result in binary, unsigned decimal and hex, plus the bit-by-bit view.

2. Example: 1011 + 0110

11 + 6 = 17, shown at 8 bits as 00010001 with no overflow.

3. What overflow means

Registers hold a fixed number of bits. At 8 bits, 11111111 + 00000001 would be 256, which needs 9 bits, so the result is truncated to 00000000 and flagged as overflow. A subtraction with a negative answer, such as 0011 − 0101, wraps to 11111110.

Word sizeUnsigned range
8-bit0 to 255
16-bit0 to 65,535
32-bit0 to 4,294,967,295
64-bit0 to 18,446,744,073,709,551,615

4. Bitwise logic

Gates work on each bit pair. 1100 AND 1010 = 1000, because only the leftmost column has two 1s. OR keeps a 1 if either bit is 1, and XOR keeps it only if exactly one is 1.

5. Shifts

A logical left shift by one doubles an unsigned value as long as no 1 bit falls off the end. An arithmetic right shift keeps the sign bit, so it divides a signed value by 2 and rounds down.

6. Next steps

Try the Binary Calculator. For worked arithmetic see binary arithmetic with examples, for negatives see two's complement explained, and for conversions see the binary conversion chart.

7. Frequently asked questions

What is a binary calculator?expand_more

A tool that does arithmetic and bitwise operations on base-2 numbers, usually inside a fixed word size such as 8 or 32 bits.

What does overflow mean?expand_more

The true result needs more bits than the register has, so the extra high bits are dropped.

Can it handle negative numbers?expand_more

Yes, through two's complement, where the top bit is the sign.

Which word sizes are supported?expand_more

8, 16, 32 and 64 bits.

8. Sources

Spotted a mistake or a number that looks off?

We fix errors quickly and note the change.