Formula Bro

Math and physics formulas, explained like you are new.


Binary Number Value

In one sentence: Binary uses only the digits 0 and 1, and this formula turns a row of those digits into the ordinary number they stand for.

N=∑i=0n−1bi⋅2iN = \sum_{i=0}^{n-1} b_i \cdot 2^{i}

Read it out loud: “N equals the sum, for every position i from 0 up to n minus 1, of bit b sub i times 2 to the power of i.”

What each symbol means

SymbolMeaning

NN

The ordinary (decimal) number that the bits stand for.

nn

How many bits the number has. An 8-bit number has n=8n = 8.

ii

The position of a bit, counted from the right and starting at 0. Position 0 is the rightmost bit.

bib_i

The bit at position ii. It is always either 0 or 1.

2i2^{i}

The place value of position ii: 1, 2, 4, 8, 16 and so on. Each place is worth twice the place on its right.

∑i=0n−1\sum_{i=0}^{n-1}

“Add up the terms for every position ii from 0 to n−1n - 1”: go through all the bits and total their values.

What the formula is doing

In everyday life we count with ten digits, 0 to 9, so our system is called decimal. Computer memory has two easy states, off and on, so computers count with two digits, 0 and 1. That system is called binary. Each binary digit is called a bit, short for binary digit.

A digit’s place decides how much it is worth. In decimal the places are ones, tens and hundreds, and each place is ten times the one on its right. In binary each place is worth two times the place on its right, so the places are 1, 2, 4, 8, 16 and so on.

To find the value, look at each bit. If it is 1, add the place value under it. If it is 0, add nothing. The formula writes exactly that: bib_i is 0 or 1, and 2i2^{i} is the place value, so each term is either 0 or a place value, and the sum is the number.

The formula has this shape because every place is a power of two. With nn bits the largest value is 2n−12^{n} - 1, and counting starts at 0, so nn bits give 2n2^{n} different values in total.

An everyday picture

Think of a row of light switches on a wall. The first switch controls one bulb, the next controls two, then four, then eight. Turning a switch on adds its bulbs to the total. A binary number works the same way: every bit that is on adds its place value, and the total of the lit bulbs is the number.

Worked example: Reading the binary number 1011

The bits are 10111011, read from left to right. That is 4 bits, so n=4n = 4. The place values from left to right are 88, 44, 22 and 11.

  1. Write the place values from left to right: 23=82^{3} = 8, 22=42^{2} = 4, 21=22^{1} = 2, 20=12^{0} = 1.
  2. Pair each bit with its place: the 1 sits in the 8 place, the 0 in the 4 place, the 1 in the 2 place and the 1 in the 1 place.
  3. Multiply each bit by its place value and add: 1⋅8+0⋅4+1⋅2+1⋅1=8+0+2+11 \cdot 8 + 0 \cdot 4 + 1 \cdot 2 + 1 \cdot 1 = 8 + 0 + 2 + 1.
  4. Total: 8+0+2+1=118 + 0 + 2 + 1 = 11.
  5. A byte is 8 bits. Its places run from 272^{7} down to 202^{0}, and setting all eight bits to 1 gives the largest value, 28−1=2552^{8} - 1 = 255. Zero is the smallest, so one byte holds 256 different values.

Answer: The binary number 10111011 is the ordinary number 11. One byte can hold the whole numbers from 0 to 255, which is 256 values in all.

The numbers in this example are recomputed by script every time the site is built.

Common mistakes

Where you will meet it

Questions people ask

Why do computers use binary and not decimal?

Electronic circuits can tell two states apart reliably: a voltage is high or low, and a switch is on or off. Ten different voltage levels are much harder to keep apart. Two states keep the hardware simple and dependable.

What is a byte?

A group of 8 bits. One byte can hold 256 different values, the whole numbers from 0 to 255.

How do I convert a decimal number to binary?

Divide by 2 again and again and write down each remainder. Read the remainders from the last one to the first. For example, 11 divided by 2 leaves remainders 1, 1, 0 and 1. Read backwards, they give 10111011.

Sources

  1. Binary number, Wikipedia
  2. Byte, Wikipedia

All Computer Science formulas |

Published 2026-10-22. Plain-text copy for AI agents and readers: computer-science/binary-number-value.md.