Math

Binary Calculator

A binary calculator takes two base-2 numbers and performs addition, subtraction, multiplication, integer division or the bitwise AND, OR and XOR operations, showing the answer in binary, decimal and hex together so you can check the working in whichever base is easier.

Last reviewed by the Radiatus Cloud team

Binary: 0
Decimal: 0
Hex: 0

Need this done properly for your business?

Radiatus delivers secure cloud, DevOps & compliance engineering.

Book a free consult

Worked examples

OperationBinaryDecimalResult
Add1010 + 010110 + 51111 (15, hex F)
Subtract1010 - 010110 - 5101 (5)
Multiply1010 × 010110 × 5110010 (50, hex 32)
Divide1010 ÷ 001110 ÷ 311 (3, remainder discarded)
AND1010 AND 01100010 (2)
OR1010 OR 01101110 (14)
XOR1010 XOR 01101100 (12)

How binary addition carries

The rules are 0+0=0, 0+1=1, 1+1=0 carry 1, and 1+1+1=1 carry 1. Adding 1010 and 0101 column by column from the right gives 1111 with no carries at all, because the ones never line up. Adding 0111 and 0001 produces a chain of carries and the answer 1000, which is the binary version of 999 plus 1 rolling over to 1000 in decimal.

What the bitwise operations are for

AND with a mask keeps only chosen bits, which is how a subnet mask extracts the network part of an IP address. OR sets bits, used for combining permission flags. XOR flips bits where the mask has a one and returns zero for two identical inputs, which makes it the basis of parity checks, checksums and the one-time pad. XOR applied twice with the same key gives back the original, a property stream ciphers depend on.

Limits worth knowing

  • Division discards the remainder, matching integer division in most languages. Use the modulo calculator for the remainder.
  • Subtraction of a larger number from a smaller one shows a negative decimal with a minus sign, not the two's complement bit pattern a CPU would hold.
  • Inputs above 53 bits lose precision because the calculation uses JavaScript numbers. That covers every practical hand calculation and most 32-bit register work.

Checking your own working

Enter the two numbers, pick the operation and compare the decimal column with a mental calculation first. If the decimal is right, the binary and hex columns are simply that value rewritten, so any surprise there is a reading error rather than an arithmetic one. For subtraction that goes negative, add a leading bit width in your head: the answer minus two is 11111110 in eight bits and 1111111111111110 in sixteen.

Related tools

  • Hex Calculator — Perform mathematical operations on hex values.
  • Number Base Converter — Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, all at once. Great for programming and networking. Private & instant.
  • Text to Binary — Convert text to binary, with the character encoding detail that decides whether it round-trips correctly.
  • IP to Binary Converter — Convert an IPv4 address between dotted decimal, binary, hexadecimal and 32-bit integer, and see why subnetting makes sense in binary.

Frequently Asked Questions

Why does 1010 minus 1100 show -2 rather than a binary pattern?

The calculator works on mathematical integers and shows the sign explicitly. In an 8-bit two's complement register the same result would appear as 11111110. Use the number base converter if you need the fixed-width representation.

What does the hex column add?

Each hex digit is exactly four binary digits, so hex is the compact way programmers write binary. 11111111 is FF, 10100101 is A5. Seeing both makes it easy to spot which nibble a bit belongs to.

How is division handled?

As integer division: 1010 divided by 0011 is 11, with the remainder of 1 dropped. Dividing by zero is not defined and the tool will not produce a result for it.

What is the largest number I can enter?

Up to 53 binary digits gives exact results. Longer inputs are accepted but the low bits may be rounded, because the arithmetic is done in double-precision floating point.

Why is XOR called exclusive or?

The result is 1 when exactly one input is 1, excluding the case where both are. It is the operation that reports where two bit patterns differ, which is why it underlies checksums and simple encryption.

Privacy & Security

Calculated locally.

Data: None
Client-side-Side
Active
v1.0

About This Tool

This tool runs entirely in your browser. No data is sent to any server, ensuring complete privacy. Simply use the interface above to get started — no registration or login required.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.