home / Math / binary calculator

Binary Calculator

The Binary Calculator is a free online tool for base-2 arithmetic and conversion. It adds, subtracts, multiplies and divides binary numbers, and converts between binary, decimal, octal and hexadecimal in both directions.

Modify the values and click the Calculate button to use.

Related: Hex Calculator | Scientific Notation Calculator | IP Subnet Calculator

Counting With Two Digits

Binary uses only 0 and 1. Each position is a power of two rather than a power of ten, so 10110101 means:

128 + 0 + 32 + 16 + 0 + 4 + 0 + 1 = 181

Computers use binary because transistors have two stable states. Everything else — text, images, instructions — is a convention layered on top of that.

Place Value Chart

Bit position76543210
Place value1286432168421
Example: 1011010110110101

Converting

Binary to decimal: add the place values wherever a 1 appears.

Decimal to binary: divide repeatedly by 2 and read the remainders backwards. 181 ÷ 2 = 90 r1, 90 ÷ 2 = 45 r0, 45 ÷ 2 = 22 r1, and so on — giving 10110101.

Binary to hexadecimal: group the bits in fours from the right and convert each group. 1011 0101 becomes B5. This exact correspondence is why hex exists in computing.

Binary Arithmetic

Addition follows four rules: 0+0=0, 0+1=1, 1+0=1, and 1+1=10 — write 0, carry 1. Multiplication is simpler still, since multiplying by 0 or 1 requires no memorised table. This simplicity is what makes binary hardware fast.

Negative Numbers and Two's Complement

Computers represent negatives using two's complement: invert every bit and add one. In 8 bits, −5 is stored as 11111011. The advantage is that subtraction becomes addition, so the same circuit handles both. It also explains why signed 8-bit values run from −128 to 127 rather than −127 to 127.

Why Byte Sizes Are What They Are

BitsValuesCommon use
8 (a byte)256One character, one colour channel
1665,536Unicode range, older audio
324.29 billionIPv4 addresses, standard integers
641.8 × 1019Modern integers, memory addresses

The 2038 problem is a direct consequence: 32-bit signed Unix timestamps overflow on 19 January 2038.

Frequently Asked Questions

Why do computers use binary rather than decimal?

Two states are easy to distinguish reliably in hardware — voltage high or low. Ten states would require far tighter tolerances and give little benefit.

What is the largest number in 8 bits?

255 unsigned, or 127 signed. This is why so many older games capped values at 255.

How do computers store decimals in binary?

Using floating point, which stores a sign, an exponent and a fraction. Some decimal values, including 0.1, cannot be represented exactly — which is the source of the familiar 0.1 + 0.2 = 0.30000000000000004 result.