Technology & Computing · Computers & hardware
Binary, bits and bytes
Everything a computer holds is a pattern of on and off. Learn to count in binary, see what bits and bytes are, and find out why one pattern can be a number, a letter or a shade.

What you will learn
- Explain place value in base two, where each place is worth double the one to its right
- Convert small numbers between binary and decimal
- Explain what a bit and a byte are and why eight bits give 256 patterns
- Explain why a drive sold as 1 TB shows up as about 931 GB in Windows
Lesson 1 of 4 · 4 min
Counting with only 0 and 1
A computer chip holds millions or billions of transistors, tiny switches that are either off or on. Engineers write off as 0 and on as 1. A digit that can only be 0 or 1 is a bit, short for binary digit.
Two states are simple to build into circuits, so almost every modern computer uses binary, the number system with only two digits. But how do you write 5 with just 0 and 1?
The same way you write 347. In place value, a digit's position sets its worth. In 347 the 3 is worth 300, because each place is worth ten times the place to its right.
Binary uses the same trick with doubling. From the right, the places are worth 1, 2, 4, 8, 16 and so on. A 1 means count this place, and a 0 means skip it. So 101 is one 4, no 2s and one 1, which makes 5.
Counting follows from this. In decimal, after 9 a place rolls back to 0 and the next place goes up. In binary that happens after 1. So you count 0, 1, 10, 11, 100, 101.
To read a binary number, write the place values above its digits and add the places that hold a 1. Take 1101. From the right the places are 1, 2, 4 and 8. The 1s sit under 8, 4 and 1, so 1101 is 13.
To write a number in binary, go the other way. Take the largest place that fits, mark a 1 and subtract it. Repeat with what's left. For 11, take 8, leaving 3. Skip 4, take 2, then take 1. That gives 1011.
Each extra digit doubles how far you can count. Use your fingers as bits, up for 1 and down for 0. One hand reaches 31, and two hands reach 1,023.
Try to recallHow would you work out what the binary number 10110 means in decimal?
Write the place values 16, 8, 4, 2 and 1 above the digits from left to right. Add the places that hold a 1, which are 16, 4 and 2. So 10110 is 22.
Binary is place value with doubling. You can read a binary number by adding the places that hold a 1, and write one by taking the largest place that fits.
Lessons in this topic
Counting with only 0 and 1
Learn how place value works with two digits instead of ten, and read and write small binary numbers yourself.
Bits, bytes and the case of the shrinking drive
See why eight bits make a byte with 256 patterns, and why a new 1 TB drive shows up as about 931 GB.
One pattern, many meanings
Read the same byte as a number, a letter and a shade of grey, and see why every file needs a format to make sense.
Hex codes and how computers store a minus sign
See why programmers write bytes in base 16, and how two's complement lets plain bits hold negative numbers.
Three quick stories from this topic
Why byte has a y
Byte is spelled with a y so nobody would confuse it with bit
Werner Buchholz coined the word in June 1956 while designing IBM's Stretch computer. He respelled bite on purpose, so a dropped letter couldn't quietly turn it into bit.
Not always eight
Early bytes came in different sizes. Eight bits became the norm after IBM's System/360 and the microprocessors of the 1970s.
Bit is older
John Tukey shortened binary digit to bit in a 1947 Bell Labs memo, and Claude Shannon put it in print in 1948.
Counting to 1,023 by hand
Your ten fingers can count to 1,023 if you use them as binary digits
Each finger is a bit, up for 1 and down for 0, worth 1, 2, 4 and so on up to 512. Raise all ten and the values add up to 1,023. One hand alone reaches 31.
Why it works
Each finger is worth double the one before it, so ten fingers cover every whole number from 0 to 1,023.
In computer terms
Ten fingers hold one and a quarter bytes this way, against less than half a byte when you count to 10 the usual way.
Gangnam Style's view count
YouTube said Gangnam Style passed the 2,147,483,647 views its counter could hold
That's the largest number a signed 32-bit integer can store. In December 2014 YouTube said it had moved the counter to 64 bits, adding that it never expected a video to pass that number.
Why that number
A signed 32-bit number spends its leftmost bit on negatives, so the top is 2 to the power 31, minus one.
Room to grow
A 64-bit counter can go past nine quintillion views, more than a billion for every person alive.
Sources
- CS50x 2024 Lecture 0 notes, Harvard University
- Bit, Wikipedia
- Binary number, Wikipedia
- Finger binary, Wikipedia
- Byte, Wikipedia
- Gangnam Style music video exceeds YouTube's view limit, PBS NewsHour
- 2,147,483,647, Wikipedia





