Beginner 5 min

Bits, bytes, and binary numbers

A bit holds 0 or 1, and eight bits make one byte.

How it works

Start at the right and label the positions 1, 2, 4, 8. A position with a 1 contributes its label to the total. In 1011, you add 8, 2, and 1. Reading 1011 as decimal would assign different position values, so the base matters.

Walk through an example

Binary position values double from right to left. In 101, the left 1 is worth 4, the middle 0 contributes nothing, and the right 1 is worth 1.

What to watch for

The same bits can represent different things depending on the format. A byte might be part of text or a numeric value.

Check your understanding

What decimal value does it represent?

See the example and explanation
Worked example
Given 1011 in binary
Answer 11

Add 8, 0, 2, and 1. The result is 11.

Open practice problem
Next lessonGit commits and diffs