Kilobytes to bytes conversion

4 views (last 30 days)
I am confused, one kilobyte is equal to 1024 bytes or 1000 bytes?
I see different opinions about this definition, for example
I understand there are different definitions, my question is which one of the two is commonly used.

Accepted Answer

Stephen23
Stephen23 on 7 Apr 2021
Edited: Stephen23 on 7 Apr 2021
The SI system defines "kilo". The SI definition of "kilo" means 1000, and has never defined it to mean 1024.
Here are the SI prefixes:
etc. etc. repeated on one million other much less reputable websites.
However, long ago in a distant land some lazy computer programmers thought they would use the already existing prefix "kilo" to mean 1024 instead. An extremely misleading, incorrect, horribly awful and regretable decision intended to inflict maximum pain and confusion upon their decendents, and was thus immediately expanded to the other SI prefixes "mega", etc. This incorrect mapping (of powers of 1024 to powers of 1000) has the unfortunate effect of diverging in value as the prefixes increase in magnitude. Sadly, some of these mappings were formalized in various IEEE/IEC standards, but never in the actual SI standard itself (i.e. the actual source of the "kilo" prefix).
This is not just an academic discussion, there have been some major court-cases based on exactly this topic, with class-action suits involving claims of misleading advertising and quite large sums of money.
It also means that computer programmers forced themselves into the completely idiotic position of not knowing what they mean when they use these prefixes, which is entirely their own fault and rather defeats the purpose of having "standards". The confusion you ask to be clarified in your question cannot be clarified, because of that stupid decision many decades ago to use the wrong prefix. Everyone experiences that confusion, not just you.
For a thorough discussion on this topic, and an introduction to the correct prefixes for powers of 1024, see:
Feel free to do more reading on this subject, e.g. what the BIPM has to say on the matter: "These SI prefixes refer strictly to powers of 10. They should not be used to indicate powers of 2"
Note 1: Usage of "kilo", "mega", etc. in this incorrect fashion is restricted only/primarily to computer memory/drives (because these are typically measured in blocks of 1024). Outside of that realm, even computer programmers use SI suffixes with their correct meaning (e.g. a 1 Gbit/s Ethernet connection transfers data at nominal speed of 1000000000 bit/s).
Note 2: According to Wikipedia "'The prefix kilo is derived from the Greek word χίλιοι (chilioi), meaning "thousand"'. While some word meanings do change over time, this one still has the original meaning!
  4 Comments
James Tursa
James Tursa on 7 Apr 2021
@Andrea Campanella There is an advantage in advertising for hard disk size to use powers of 10, and I have often found small print somewhere on the packaging indicating this. E.g., just doing a search for a 1TB drive on Amazon yielded a product with this statement in the description:
As used for storage capacity, one terabyte (TB) = one trillion bytes
I would guess that all hard drive manufacturers use this definition these days to make sure their product appears as large as possible to the consumer.
But for reported file size or available disk space on an OS or other tool, you need to be careful as Stephen advises. The file may be physically stored on the drive in blocks that are powers of 2, but whether the OS or tool reports it in that way to you is another matter. It can be a shock to the uninitiated the first time they connect their new 1TB drive and have the OS report it as only 931GB because the manufacturer used powers of 10 but the OS used powers of 2.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!