Coding & Information Theory

Binary, Bits and Bytes: The Basics

Everything a computer stores is bits. Learn how binary works and how bits and bytes underpin QR codes and all digital data.

Binary is the two-symbol language every computer speaks, built from bits and bytes. Understanding base-2, the humble bit, and the powers of two behind it unlocks how all digital data works — including the black-and-white squares of a QR code.

Computers seem impossibly complex, yet underneath they juggle just two values: on and off, one and zero. Everything else — text, photos, music, this very page — is built from that tiny alphabet. Let's meet the bit, the byte, and the powers of two, and see how the same idea makes a QR code readable. 🐾

What is binary?

Binary is a number system with only two digits: 0 and 1. We usually count in base-10 (decimal), which uses ten digits, 0 through 9, because we have ten fingers. Binary is base-2 — it uses just two. That's the whole difference.

Why would anyone count with only two digits? Because two states are easy for machines to store reliably. A switch is on or off, a wire carries voltage or it doesn't, a spot on a disc reflects or it doesn't, a QR module is dark or light. Two clean, distinct states resist confusion far better than trying to squeeze ten voltage levels onto a wire. Binary is the language of anything that can be in one of two conditions.

What is a bit?

A bit — short for "binary digit" — is a single 0 or 1. It's the smallest possible unit of information: one yes-or-no answer, one flip of a coin, one switch. The term comes from information theory, where the bit is defined as the amount of information in a single choice between two equally likely options. Our introduction to information theory explores that idea further.

One bit alone can't say much — just this or that. The magic happens when you line bits up. With more bits, you can represent more distinct things, and the number of possibilities grows fast.

How do powers of two work?

Each time you add a bit, you double the number of combinations. One bit gives 2 possibilities (0, 1). Two bits give 4 (00, 01, 10, 11). Three bits give 8. The pattern is the powers of two:

BitsCombinationsPower of two
1221
2422
41624
825628
101,024210

This doubling is why computer numbers cluster around familiar figures like 256 and 1,024. It also explains why capacities jump the way they do: adding one bit doesn't add a little, it multiplies the possibilities by two.

What is a byte?

A byte is a group of 8 bits. Because 8 bits give 28 = 256 combinations, one byte can represent any of 256 different values — say, the numbers 0 to 255. The byte became the standard chunk of computer memory because 256 values is just enough to cover every letter, digit, and punctuation mark in early text systems, with room to spare.

Bytes are the everyday currency of computing. File sizes, memory, and storage are all measured in bytes and their multiples — kilobytes, megabytes, gigabytes. When someone says a file is "2 kilobytes," they mean roughly 2,000 bytes, or about 16,000 individual bits.

A bit is a single yes-or-no. A byte is eight of them bundled together, enough to name any of 256 things. Nearly all digital data is measured in bytes.

How does binary represent letters and numbers?

A bit or byte is just a pattern until we agree what it means — that agreement is encoding. To store text, computers use a character standard that assigns each letter a number, then stores that number in binary. In classic ASCII, the capital letter "A" is 65, which in binary is 01000001 — exactly one byte. Feed a computer that byte with the ASCII agreement in place, and it shows you an "A."

The same trick handles numbers, colors, and sound. A color might be three bytes, one each for red, green, and blue. A moment of audio is a number sampled thousands of times a second. Underneath every kind of data is the same foundation: patterns of bits, interpreted through an agreed scheme. Our guide to how computers represent text traces this from ASCII to modern Unicode.

How does binary underlie a QR code?

Here's where it gets tangible. A QR code is a grid of small squares called modules, and each module is either dark or light — a physical, printed bit. Dark can stand for 1 and light for 0 (with some clever masking applied). Read the modules in the right order and you get a stream of bits; group them into bytes and decode them, and out comes the text the code carries.

So a QR code is binary you can see. The information theorist's abstract bit becomes an actual square of ink you could point at. When a scanner reads the code, it's converting those visible bits back into the bytes of a web address or message. The anatomy of a QR code shows how those modules are arranged into data regions, finder patterns, and more.

Why does binary matter for capacity and error correction?

Because everything is counted in bits, a QR code's capacity is ultimately a bit budget. A given code size holds only so many modules, and those modules must be split between your actual data and the redundant bits used for error correction. Spend more bits protecting the message and you have fewer for the message itself — a real trade-off explored in QR code error correction.

This is the quiet reason binary is worth understanding. Once you see data as counted bits, choices that seemed mysterious — why a code gets denser as you add text, why higher error protection shrinks capacity — become simple arithmetic. It's all powers of two, all the way down.

Binary in one sentence

Binary represents all information as patterns of two symbols, bundled into bits and bytes, with powers of two governing how much those patterns can hold — the same on/off logic that turns a grid of dark and light squares into a scannable QR code.

Want to see bits become something useful? You can create a free QR code with QR Puppy and turn your text into a grid of visible binary — free, static, and private.

Frequently asked questions

Why do computers use binary instead of decimal?

Because two clean states — on and off — are far easier for hardware to store and tell apart reliably than ten voltage levels. Binary's simplicity makes it robust against noise, which is why it's the foundation of all digital electronics.

How many values can one byte hold?

256, because a byte is 8 bits and 2 to the power of 8 equals 256. That's usually expressed as the numbers 0 through 255, which is just enough to cover the basic text characters early computers needed.

Is each QR module really a single bit?

Essentially yes — each module is dark or light, standing for a 1 or 0. After a masking pattern is accounted for, those visible squares are read as a stream of bits and grouped into bytes to recover the data.

What's the difference between a bit and a byte?

A bit is a single binary digit, 0 or 1. A byte is eight bits grouped together, capable of representing 256 values. File and memory sizes are measured in bytes because a byte is the standard unit of storage.

Why do computer sizes use numbers like 1,024 instead of 1,000?

Because they follow powers of two. 1,024 is 2 to the power of 10, which falls naturally out of binary counting, whereas 1,000 is a round number only in our decimal system.

Make a QR code the honest way 🐾

Free forever, no tracking, no expiry — generated right in your browser.

🎨 Create a QR code →