Mathwords logoMathwords

Binary Number System — Definition, Formula & Examples

The binary number system is a way of writing numbers using only two digits: 0 and 1. Each position in a binary number represents a power of 2, just as each position in our everyday decimal system represents a power of 10.

The binary number system is a base-2 positional numeral system in which every number is expressed as a finite string of the digits 0 and 1. The value of each digit is determined by its position, where the rightmost digit represents 202^0, the next represents 212^1, and so on, with the total value being the sum of each digit multiplied by its corresponding power of 2.

Key Formula

N=dn2n+dn12n1++d121+d020N = d_n \cdot 2^n + d_{n-1} \cdot 2^{n-1} + \cdots + d_1 \cdot 2^1 + d_0 \cdot 2^0
Where:
  • NN = The decimal (base-10) value of the binary number
  • dn,dn1,,d0d_n, d_{n-1}, \ldots, d_0 = The individual binary digits (each is 0 or 1), from leftmost to rightmost
  • nn = The position of the leftmost digit, counting from 0 on the right

How It Works

To read a binary number, start from the rightmost digit and assign increasing powers of 2 moving left. Each digit (called a **bit**) is either 0 or 1. If the bit is 1, you add that power of 2 to the total; if it is 0, you skip it. For example, in the binary number 1011, the positions from right to left represent 20=12^0 = 1, 21=22^1 = 2, 22=42^2 = 4, and 23=82^3 = 8. You add 8+0+2+1=118 + 0 + 2 + 1 = 11. To convert a decimal number to binary, you repeatedly divide by 2 and record the remainders from bottom to top.

Worked Example

Problem: Convert the binary number 11010 to decimal.
Step 1: Write out the place values from right to left. The five positions represent powers of 2 from 0 to 4.
24,  23,  22,  21,  20=16,  8,  4,  2,  12^4,\; 2^3,\; 2^2,\; 2^1,\; 2^0 = 16,\; 8,\; 4,\; 2,\; 1
Step 2: Line up each binary digit with its place value. The binary number 11010 has digits 1, 1, 0, 1, 0.
1×16,  1×8,  0×4,  1×2,  0×11 \times 16,\; 1 \times 8,\; 0 \times 4,\; 1 \times 2,\; 0 \times 1
Step 3: Multiply each digit by its place value.
16,  8,  0,  2,  016,\; 8,\; 0,\; 2,\; 0
Step 4: Add the results together.
16+8+0+2+0=2616 + 8 + 0 + 2 + 0 = 26
Answer: The binary number 11010 equals 26 in decimal.

Another Example

This example works in the opposite direction — converting decimal to binary using repeated division — whereas the first example converted binary to decimal using place values.

Problem: Convert the decimal number 45 to binary.
Step 1: Divide 45 by 2. Record the quotient and the remainder.
45÷2=22 remainder 145 \div 2 = 22 \text{ remainder } 1
Step 2: Keep dividing the quotient by 2 and recording remainders.
22÷2=11 R 011÷2=5 R 15÷2=2 R 122 \div 2 = 11 \text{ R } 0 \quad\rightarrow\quad 11 \div 2 = 5 \text{ R } 1 \quad\rightarrow\quad 5 \div 2 = 2 \text{ R } 1
Step 3: Continue until the quotient reaches 0.
2÷2=1 R 01÷2=0 R 12 \div 2 = 1 \text{ R } 0 \quad\rightarrow\quad 1 \div 2 = 0 \text{ R } 1
Step 4: Read the remainders from bottom to top to form the binary number.
4510=101101245_{10} = 101101_2
Answer: The decimal number 45 is 101101 in binary.

Visualization

Why It Matters

The binary number system is essential in computer science courses, where every piece of data — from text to video — is ultimately stored as sequences of 0s and 1s. Understanding binary helps in fields like software engineering, cybersecurity, and electrical engineering. Even in middle-school math, working with different bases strengthens your understanding of place value and number representation.

Common Mistakes

Mistake: Reading binary digits as a decimal number (thinking 1010 means one thousand and ten).
Correction: Binary 1010 is not "one thousand ten" — it equals 8+0+2+0=108 + 0 + 2 + 0 = 10 in decimal. Always identify the base before interpreting the digits.
Mistake: Assigning place values starting from the left instead of the right.
Correction: Place values always start with 20=12^0 = 1 at the rightmost position and increase moving left. Starting from the wrong side will give an incorrect result.
Mistake: Forgetting to read remainders from bottom to top when converting decimal to binary.
Correction: In the repeated-division method, the first remainder you get is the rightmost bit. You must read the collected remainders in reverse order (bottom to top) to get the correct binary number.

Check Your Understanding

What is the decimal value of the binary number 10110?
Hint: The place values from right to left are 1, 2, 4, 8, 16.
Answer: 16+0+4+2+0=2216 + 0 + 4 + 2 + 0 = 22
Convert the decimal number 19 to binary.
Hint: Divide 19 by 2 repeatedly and read the remainders from bottom to top.
Answer: 19=10011219 = 10011_2
How many different numbers (including 0) can you represent with 4 binary digits?
Hint: Each of the 4 positions can be 0 or 1.
Answer: 24=162^4 = 16 different numbers (0 through 15).

Related Terms

  • DigitBinary uses only the digits 0 and 1
  • Natural NumbersBinary represents natural numbers in base-2
  • IntegersSigned binary can represent negative integers
  • Even NumberA binary number ending in 0 is always even
  • NonnegativeUnsigned binary represents nonnegative values
  • Cardinal NumbersBinary encodes cardinal numbers for counting
  • Composite NumberComposite numbers have binary representations too
  • Negative NumberNegative numbers use special binary conventions