Binary Calculator

Perform binary arithmetic (add, subtract, multiply, divide) and convert between binary (base-2), decimal (base-10), hexadecimal (base-16), and octal (base-8) instantly.

Number Base Systems

SystemBaseDigits UsedExample
Binary20, 11010₂ = 10
Octal80–712₈ = 10
Decimal100–910
Hexadecimal160–9, A–FA₁₆ = 10

Binary Arithmetic Rules

0 + 0 = 0    0 + 1 = 1    1 + 0 = 1    1 + 1 = 10 (carry 1)
Subtraction uses two's complement method
Binary × 2 = left shift by 1 bit
Binary ÷ 2 = right shift by 1 bit

Powers of 2 Reference

2^nDecimalBinary
2⁰11
210
4100
81000
2⁴1610000
2⁷12810000000
2⁸256100000000
2¹⁰1,024 (1 KB)10000000000
2²⁰1,048,576 (1 MB)100000000000000000000

Frequently Asked Questions

Why do computers use binary?

Electronic circuits are most reliable with two states: on (1) and off (0). Binary arithmetic can be implemented with simple logic gates (AND, OR, NOT). Using more states would require more complex and error-prone circuitry. Binary maps directly to the physical reality of digital electronics.

What is two's complement?

Two's complement is the standard method for representing negative numbers in binary. To negate a number: invert all bits (one's complement) then add 1. This lets the CPU perform subtraction using the same addition circuits. An 8-bit signed integer ranges from −128 to +127.

How do I convert a decimal fraction to binary?

Multiply the fractional part by 2 repeatedly, recording the integer part each time. For example, 0.625: 0.625×2=1.25 (bit=1), 0.25×2=0.5 (bit=0), 0.5×2=1.0 (bit=1) → 0.625 = 0.101₂. Some fractions (like 0.1) have infinite binary representations, causing floating-point rounding in computers.

Related Calculators