Have you ever bought a brand new SSD with 256GB on it's label, then when connecting it to a computer the storage space of only 240GB was showing? Were you taught in school that a 'kilobyte' is actually 1024 bytes, not 1000 bytes as the metric system would suggest? Well, it's true but the same time it's not.
The SI calculation
To put it simple, there are two ways of calculate the multiples of data units in the IT industry. Traditionally K stands for Kilo, M for Mega, T for Tera, P for Peta etc. metric multipliers. They are all the powers of 1000 (103), as they are based on our decimal system. However, in IT from the very beginning of times multipliers always have been the powers of 2, namely powers of 2^10 that equals 1024. This is because computers are using the binary system, so calculating with multiples of 1024 aligned more naturally with computer logic.
1000 or 1024?
The problem is that people started to handle this matter very liberally. For actual calculations most likely 1024 is used as the multiplier. However, storage manufacturer prefers the SI way, with the 1000 multiples as that produces a seemingly higher number of storage space.
For example, take a disk with 256,000,000,000 bytes. If they use the powers of 1000 as the multiplier, they will get 256,000,000,000 / 10003 = 256 GB to be put on the label of the disk. However, using the classic 210 multiplier, the result will only be 256,000,000,000 / 10243 = 238 GB. For storage manufacturers, it's more appealing to go the SI way, but this generates confusion as there is really no way to say which calculation was used when kilo, mega, giga, etc prefixes are present.
When someone says "one kilobyte" it isn't clear it they mean 1000 bytes as the SI measurements dictates, or 1024 bytes as the old IT convention was measuring "kilo".
Kilo binary = Kibi!
Finally, In 1995 the International Electrotechnical Commission (IEC) came out with a proposal of using the following prefixes for the latter: Kibi - kilo binary, Mebi - mega binary, Gibi - giga binary, Tebi - tera binary, etc. They mark the difference with a lowercase 'I' after the classical multiplier letter. KiB stands for kibibites, PiB is pebibites, etc.
Windows and Unix systems both use this system, they mark 1024 as 1K, 1024K as 1M, etc.
See the Screenshots below. Windows marks Gibitites as GB. The next screenshots how a CentOS machine, by default it's also displaying Gibites when files are listed with the -h (human readable) switch.
However, if we want to view file sizes displayed in the SI format, we simply need to use the ls --si switch as seen below.
The conclusion is that in IT, data units should - as technically calculated the IEC way - really be called Kibi-, Mebi-, Gibi-, etc bytes or bits. However, because these units have never made their way into our everyday language, they are still called giga-, tera-, etc so just be aware of the differences and know why are actual storage spaces are smaller than they are actually labelled 🙂
Comments