digiwleeaLearn
Open the lab →

Bits, bytes, and KiB vs KB

Counting storage, and the 1024 versus 1000 gap

3 min read

A byte is 8 bits, and larger amounts of storage use prefixes that come in two flavors: binary prefixes (KiB, MiB, GiB) that multiply by 1024, and decimal SI prefixes (KB, MB, GB) that multiply by 1000, which is why a drive's advertised size looks smaller once formatted.

A single bit is one 0 or 1. Bits are small, so we count storage in bigger lumps. The foundational one is the byte: eight bits, enough to hold one ASCII character or a number from 0 to 255. A byte is the smallest chunk most machines address individually, which is why memory sizes are quoted in bytes, not bits.
1 byte
= 8 bits 1 nibble
= 4 bits (one hex digit)

Two families of prefix

Above the byte, prefixes scale things up, and here is the catch that trips everyone: there are two systems, one based on 1000 and one on 1024. Computers naturally work in powers of two, and 2^10 = 1024 happens to sit near 1000, so the same letter got used loosely for both. Standards later split them:
namesymbolmultiplierbytes
kilobyteKB10001000
kibibyteKiB10241024
megabyteMB1000^21,000,000
mebibyteMiB1024^21,048,576
gigabyteGB1000^31,000,000,000
gibibyteGiB1024^31,073,741,824
The decimal (SI) prefixes multiply by 1000; the binary (IEC) prefixes, spelled with an extra 'i', multiply by 1024. The gap grows with each step: 2.4% at kilo, but about 7.4% by giga.

Why a 500 GB drive shows less

Drive makers advertise in decimal GB (500 GB = 500,000,000,000 bytes) because the number looks bigger. Many operating systems report in binary GiB but label it "GB". So 500,000,000,000 / 1,073,741,824 is about 465, and the drive shows as 465 GB. No bytes went missing; the same count was divided by 1024^3 instead of 1000^3. RAM, by contrast, is almost always sized in true binary units (a 16 GB stick is 16 GiB), because memory addressing is inherently a power of two.
Common mistakes. Do not confuse a bit (b) with a byte (B): a 100 Mb/s network link moves about 12.5 MB/s, an eightfold difference. And do not assume KB always means 1024; strictly, KB = 1000 and KiB = 1024, though older software and casual usage often say "KB" when they mean KiB.
Try it
How many bits are in 2 KiB? And how many bytes in 2 KB?

Frequently asked

How many bits are in a byte?

Eight. A byte is 8 bits, enough to store one character or an integer from 0 to 255. Half a byte (4 bits) is a nibble, which is exactly one hexadecimal digit.

What is the difference between KB and KiB?

A kilobyte (KB) is 1000 bytes (decimal SI prefix); a kibibyte (KiB) is 1024 bytes (binary IEC prefix). The same distinction repeats at every scale: MB vs MiB, GB vs GiB. The binary units are always slightly larger, and the gap widens at higher scales.

Why does a hard drive show less space than advertised?

Manufacturers count in decimal GB (1000^3 bytes) while many operating systems display binary GiB (1024^3 bytes) but call it "GB". Dividing the same byte count by the larger 1024^3 gives a smaller number, so a 500 GB drive shows as about 465 GB. No storage is lost; only the unit differs.
Bytes are the currency the rest of the machine trades in: an instruction is a byte, a register holds a byte, and RAM is a bank of bytes the CPU addresses by number.

Every lesson here builds toward one thing: a working CPU, from the transistor up.

Open the free lab →
Found this useful? Share itShare on X