Reading a Byte (Binary to Decimal)

BeginnerAbout 15 minData & binary

You've seen bytes as 0s and 1s. Here's how to actually read what number one means.

The Idea: Every Position Has a Value

In binary, each position (going right to left) is worth double the one before it: 1, 2, 4, 8, 16, 32, 64, 128. A "1" in that position means you count its value. A "0" means you don't.

To find the decimal value of a byte, add up the values of every position that has a 1.

Example 1: A Simple One

00000101

1280
640
320
160
80
41
20
11

4 + 1=5

Only two positions are 1: the "4" position and the "1" position.

4 + 1 = 5

So 00000101 is 5.

Example 2: A Full Worked Byte

10110101

1281
640
321
161
80
41
20
11

128 + 32 + 16 + 4 + 1=181

Positions with a 1: 128, 32, 16, 4, 1.

128 + 32 + 16 + 4 + 1 = 181

So 10110101 is 181.

Example 3: All Zeros, All Ones

The lowest a byte can be is 00000000 — nothing lit, so it's 0.

1280
640
320
160
80
40
20
10

The highest is 11111111 — every position lit:

1281
641
321
161
81
41
21
11

128 + 64 + 32 + 16 + 8 + 4 + 2 + 1=255

That's why a byte can only hold values from 0 to 255 — 256 possible values in total, exactly as we covered in Bits, Bytes, and Beyond.

Converting the other way? See how to pad a short result correctly in Writing a Byte.

Try It Yourself

Tap a tile to flip it.

128
64
32
16
8
4
2
1

Decimal value0

Practice

Can you read binary like a pro? Ten bytes, one focused round. Let's find out.

Why This Matters

This is the exact skill behind converting binary to hex or decimal anywhere — file sizes, color codes, IP addresses, memory addresses. Once you can read one byte, you can read any of them.