Skip to content
CalcPilot
Salary calculator: gross to net pay for Canada, the US, the UK, France and Germany
Math

Binary Calculator

Convert numbers between decimal and binary in either direction.

Try an example

Result

11111111

About this calculator

What Is the Binary System?

The binary system is a way of writing numbers using only two digits, 0 and 1. It works exactly like the decimal system you use every day, except that each place is worth a power of 2 instead of a power of 10. Reading from the right, the places are worth 1, 2, 4, 8, 16, and so on. Nearly all modern computers use binary because two states — on and off, high voltage and low voltage — are simple and reliable to build with logic gates. This binary calculator adds, subtracts, multiplies and divides binary numbers, and converts between binary and decimal.

Converting Binary to Decimal

Multiply each digit by its place value and add the results. For 1011₂: 1×8 + 0×4 + 1×2 + 1×1 = 11. Another way is to start with the leftmost digit and repeatedly double the running total and add the next digit.

Worked Example

255 in decimal converts to 11111111 in binary — the maximum value representable in 8 bits, or one byte.

Converting Decimal to Binary

Divide the number by 2 repeatedly and write down each remainder. The binary number is the remainders read from last to first. To convert 13: 13 ÷ 2 = 6 remainder 1; 6 ÷ 2 = 3 remainder 0; 3 ÷ 2 = 1 remainder 1; 1 ÷ 2 = 0 remainder 1. Reading upward gives 1101₂.

Binary Arithmetic

  • Addition: 0+0 = 0, 0+1 = 1, 1+1 = 10 (write 0, carry 1). For example, 101 + 011 = 1000.
  • Subtraction: borrow from the next place when needed — 10 − 1 = 1 after borrowing.
  • Multiplication: works like long multiplication, but each partial product is either 0 or a shifted copy of the number.
  • Division: done with repeated subtraction and shifting, like long division in decimal.

Why Binary Matters

Every file, picture and program on a computer is ultimately a long string of bits (binary digits). Eight bits make a byte, which can represent 256 different values. Programmers often group bits in fours to write them in hexadecimal (base 16), a compact shorthand — see the Hex Calculator. Binary logarithms and powers of 2 also appear in the Log Calculator and the Exponent Calculator.

Worked example

255 in decimal converts to 11111111 in binary — the maximum value representable in 8 bits (a byte).

Frequently asked questions

Why is binary used in computing?

Computer hardware represents data as electrical signals that are most reliably distinguished as two states (on/off) — binary's two digits (0 and 1) map directly onto that, making it the natural base for digital systems.

How do I do binary arithmetic (addition, subtraction)?

The simplest approach: convert each binary number to decimal, do the arithmetic in decimal, then convert the result back to binary using this calculator.

What's the difference between binary and hexadecimal?

Both are alternate number bases; hexadecimal (base 16) is often used alongside binary because each hex digit maps to exactly 4 binary digits, making hex a more compact, human-readable way to represent binary data.

More Math calculators

Advertise on CalcPilot