You are here

There are not 1024 bytes in a kilobyte!

Submitted by jbrown on Tue, 07/23/2013 - 19:25

According to the SI standard, there are 1000 bytes in a kilobyte.

There is another standard called IEC that has 1024 bytes in a kibibyte, but this is only useful when measuring things that are naturally a power of two, e.g. a stick of RAM.

https://en.wikipedia.org/wiki/Kilobyte
https://en.wikipedia.org/wiki/Kibibyte
https://en.wikipedia.org/wiki/Binary_prefix

Currently Drupal renders IEC quantities with SI units which is incorrect.

Most people find it very confusing and surprising for files to use IEC (1024 bytes in a kibibyte) because everything else in the world uses 1000 (litres, kilograms). Apple is leading the way by switching to SI: https://en.wikipedia.org/wiki/Binary_prefix#Operating_systems

Drupal should follow suit. I have created a patch for Drupal 8: https://www.drupal.org/node/1114538#comment-7674739

Add new comment