Skip to content
digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksBuild a CPUToolsOpen the lab →

KB vs KiB and MB vs MiB: 1000 or 1024?

Two sets of units measure data. The decimal (SI) prefixes count in powers of 1000: a kilobyte (kB) is 1000 bytes, a megabyte (MB) 1,000,000 bytes and a gigabyte (GB) 1,000,000,000 bytes. The binary prefixes count in powers of 1024 (2^10): a kibibyte (KiB) is 1024 bytes, a mebibyte (MiB) 1,048,576 bytes and a gibibyte (GiB) 1,073,741,824 bytes. The binary names were approved as an international standard by the IEC in December 1998, according to NIST, to end the confusion of using kilo, mega and giga for both meanings; the binary prefixes are not part of the SI. The gap grows with size: 2.4% at kilo, about 4.9% at mega, 7.4% at giga and almost 10% at tera.

When each one is used

Binary units match how memory is built: a memory chip with n address lines has 2^n locations, so RAM sizes come out as exact powers of two (8 GiB is 8 x 1,073,741,824 bytes). Decimal units match the SI and are what storage capacities and network speeds are usually quoted in. The mismatch explains a familiar puzzle: a drive sold as 1 TB holds 10^12 bytes, which is about 931 GiB, so software that counts in binary units shows less than the label, though nothing is missing.

Why powers of two, in digiwleea

Powers of two come straight from the hardware. Each address bit doubles the number of locations a decoder can select: a 2-to-4 decoder picks one of 4, a 4-to-16 decoder one of 16, and 10 address bits give 1024, one kibi. In the course you build the RAM and its address decoder yourself; the bit vs byte page covers the smaller units.

Decimal and binary prefixes

Decimal (SI)BytesBinary (IEC)Bytes
kB (kilo)1000KiB (kibi)1024
MB (mega)1,000,000MiB (mebi)1,048,576
GB (giga)1,000,000,000GiB (gibi)1,073,741,824
TB (tera)10^12TiB (tebi)2^40 = 1,099,511,627,776
PB (peta)10^15PiB (pebi)2^50
EB (exa)10^18EiB (exbi)2^60

No sign-up is needed to start: open the lab and place your first transistor, or read the free theory course. The account (and the AI tutor) are optional.

More comparisons: Digital logic concepts compared

See for yourself: build a logic gate from transistors in the simulator, then follow the path from sand to an 8-bit CPU.

Open the digiwleea lab →

Frequently asked

Is a kilobyte 1000 or 1024 bytes?

By the SI and IEC standards, a kilobyte (kB) is 1000 bytes and a kibibyte (KiB) is 1024 bytes. In older usage, KB often meant 1024 bytes, which is the confusion the binary prefixes were created to remove.

What is the difference between MB and MiB?

An MB (megabyte) is 1,000,000 bytes; an MiB (mebibyte) is 1,048,576 bytes, about 4.9% more.

Why does my 1 TB drive show less space?

The drive holds 10^12 bytes, as labelled. Software that measures in binary units divides by 2^40 and shows about 931, labelled GiB or sometimes GB.

When were KiB and MiB introduced?

The International Electrotechnical Commission (IEC) approved the binary prefixes kibi, mebi, gibi, tebi, pebi and exbi in December 1998.