Kilobytes vs. Kibibytes

Why storage sizes are always a little off

Ozaner Hansha
3 min readJan 4, 2019

It’s a common occurrence, you buy a new phone or hard drive marketed at, say, 128GB. But when you go and check the maximum capacity of your device in the settings, you find that its less than advertised! What gives!?

One culprit is the preloaded software that comes on the device needed to run it. For phones this comes in the form of the OS, and other firmware. Hard drives themselves also have preloaded software but require much less of it.

But even accounting for this extra space, there is still a discrepancy. For this we can blame the difference between a kilobyte (kB) and a kibibyte (kiB).

Before we begin though, let’s first review the standard decimal prefixes we are all familiar with:

Decimal Prefixes

When dealing with very large or very small quantities it is common to append, or rather prepend, one of the SI (metric system) prefixes to whatever unit is being used. For example, the average human weighs 62000g but because that number is cumbersome to use, we usually append kilo- (the SI prefix meaning a thousand) to the gram unit and write 62kg instead.

This system works just fine for all sorts of units of measure like mass (kg), length (km), energy (kJ), etc. But when it’s applied to units of information, specifically binary ones like bits and bytes, a problem arises…

Binary Prefixes

Historically when computer scientists used the word kilobyte (kB) they didn’t mean 1000 bytes. They meant 1024 bytes. This is because computers operate in binary. Which is to say, they process and store information using 0s and 1s, aka bits. As a result, it is convenient to measure information using powers of 2. This clashes with the SI system which measures units in powers of 10.

However, because 2¹⁰ = 1024 which is almost 1000, the kilo- in kilobyte was close enough for the computer scientists of the era. And so the slightly misleading convention was accepted and extended to higher denominations of storage as well, from megabytes (MB) to terabytes (TB).

This all changed around 1998 when the International Electrotechnical Commission (IEC) and other regulatory organizations banded together to create a new set of prefixes to be used for information storage to be used in lieu of the SI ones. Enter binary prefixes. By replacing the last two letters at the end of the old prefixes with a -bi, the IEC essentially made a copy of the familiar SI prefixes that matched computer scientists’ 2¹⁰ version:

Soon the US National Institute of Standards and Technology (NIST) followed suit and required that the SI prefixes only be used in the decimal sense.

Transitioning from Decimal to Binary

So problem solved, right? Well… no. Most people have never heard of a kibibyte (kiB), mebibyte (MiB), or gibibyte (GiB) and probably never will. Hardware manufacturers know this and, rather than deal with the average consumer’s outdated perception of information storage, opt to just use the closest decimal prefix.

That said, there are a growing number of software and hardware applications that make use of binary prefixes. Who knows, one day we might live in a world where the symbols ‘GiB’ and ‘TiB’ are commonplace. But it probably won’t be anytime soon…

Relevant xkcd

--

--

Ozaner Hansha

Interested in Machine Learning, Math, Quantum Computing, Philosophy, etc. My projects/notes are on https://ozaner.github.io