How this calculator works
- Step 1Place values…8 4 2 1Each place is worth twice the one to its right.
- Step 2CalculateExactThe numbers are added, multiplied or compared exactly.
- Step 3Write backEvery baseThe answer is shown in binary, octal, decimal and hex.
Binary uses only two digits, 0 and 1. Reading from the right, the places are worth 1, 2, 4, 8 and so on. To write a decimal number in binary, divide by 2 repeatedly and read the remainders from last to first: 100 becomes 1100100.
Worked example: 1001 + 11011
- Rule
1 + 1 = 10: write 0, carry 1
- 10018 + 19
- 1101116 + 8 + 2 + 127
- Sum in binary100100
- Sum in decimal9 + 2736
This is OpenStax Contemporary Mathematics Example 4.33.
Arithmetic and bitwise operations
- Arithmetic1101 ÷ 11 = 100 r 1Add, subtract, multiply and whole-number divide.
- BitwiseAND 1000 · XOR 110Compare 1100 and 1010 one bit at a time.
Read the result
The headline is the answer in binary; the table repeats it in octal, decimal and hexadecimal.
Division gives the whole-number quotient and the remainder, as when dividing by hand.
Assumptions and limits
- Whole numbersNo binary fractions or floating point.
- Any sizeExact up to 128 binary digits in each input.
- Sign, not two’s complementNegative numbers are written with a minus sign.
Related base tools
Binary and hexadecimal are two ways of writing the same bits.
For base-16 arithmetic, use the hex calculator. Subnet masks are binary arithmetic on addresses, which the IP subnet calculator works out, and the chmod calculator turns permission bits into octal.
Common mistakes
Mistake: Reading 10 in binary as ten.
Instead: Binary 10 is two; check the decimal line.
Mistake: Forgetting the carry: 1 + 1 = 2.
Instead: In binary 1 + 1 = 10: write 0 and carry 1.
Checking the method
Every golden case is rechecked with Python’s own base conversion, and two OpenStax examples are reproduced.
An independent script reads each number with Python’s int(text, 2) and writes results with its built-in formatting.
Read how we test our calculators, or browse more maths calculators.