20

One "kilobyte" (KB) is 1024 bytes in JEDEC-standard, whereas the definition has shifted, in most contexts, to mean 1000 bytes (kB) in accordance with SI. To resolve this difference, binary prefixes (kiB) are used.

So we have 3 choices for using prefixes - JEDEC, IEC (both in Binary), and Metric (in Decimal).

My questions are-

  1. What prefix standard does Windows use in showing the file size? (surely it's not IEC standard)
  2. Why does Windows OS show sizes of files in KB (using a capital alphabet "K") when it's a small alphabet "k" for a Kilo in SI units?

A capital "K" represents Kelvin in SI system of units.

Am I missing something here in understanding?

  • 9
    @Luaan: SI conventions are the most common conventions by far for units, even for non-SI units. For example, they're trying to run the LHC at 13 TeV, but eV (electron volt) is not SI. When you say that the ambient noise level is 40 dB, the B (bel) is not SI either. – Dietrich Epp Jul 9 '15 at 11:46
  • 2
    @DietrichEpp: That's still physics. The byte is not a unit of physics; physicists measure information as entropy (unit: J/K). – MSalters Jul 9 '15 at 12:58
  • 3
    Relevant: xkcd.com/394 – basic6 Jul 9 '15 at 12:59
  • 3
    @MSalters: The "Bel" is not physics, it is an abstract unit like the byte. – Dietrich Epp Jul 9 '15 at 13:05
  • 2
    I do mean "abstract" in that the Bel does not correspond to any concrete (or physical) system. It is only used to express a ratio, not even a ratio of something in particular (like power). For example, in digital signal processing the dB will be used to express ratios of digital signals which have no physical units to begin with. So I strongly disagree with the notion that decibel is a "physical" unit, or connected to physics in any special way. – Dietrich Epp Jul 9 '15 at 14:08
41

I'll answer your question as directly as possible since the usage KB vs. KiB vs. kB vs. kb will quickly spawn an off-topic debate as that naming convention war has been going on for decades now.

1.) What prefix standard Windows use in showing file size? (surely it's not IEC standard)

Actually it's the JEDEC 100B.01 standard which means that KB (Killobyte) is 1024 Bytes.

2.) Why Windows OS show size of files in KB (using a capital alphabet "K") when it's a small alphabet "k" for a Kilo in SI units.

Again, because it's the JEDEC 100B.01 standard for unit prefixes for semiconductor storage capacity; it's not an SI unit of measure and thus does not have the same meaning.

The lowercase k can be synonymous with uppercase K when dealing with kilo / kibi; for giga, mega and tera, JEDEC, ISO and BIPM SI prefix norms define them to be uppercase G, M and T respectively. Lowercase g, m and t are used only in informal situations, when context provides the meaning (as in I just swapped out my 1gb NIC or my 2tb hdd isn't working), and are per se invalid.

A capital "K" represents Kelvin in SI system of units. Am I missing something here in understanding?

Yes, a capital K represents Kelvin when you are specifically talking about measurements of temperature and dealing with SI units of measure, however, we are dealing with semiconductor storage capacity and I would not say I have 512 KB of RAM and mean I have 512 Kelvin Bytes of RAM. Further, it really depends on context to know when/how to differentiate between the IEC/JEDEC and SI units of measuring KB/MB/GB/etc.

Most OS's and the vast majority of devices that deal with memory/storage use the prefixes K for Kilo to mean 1024 bytes, so when I get RAM that says it's a 4GB module, I know it's 4 Gibi-Bytes (4*1024*1024*1024) and not Giga-Bytes (4*1000*1000*1000).

The major exception to this is in drive capacities; when I purchase a thumb drive or hard drive, I know when it says 32GB, it means 32 Giga-Bytes (32*1000*1000*1000) and not Gibi-Bytes (32*1024*1024*1024), even though my OS will report it in Gibi-Bytes (and thus take my drive from 32GB to an effective 29.8 GiB drive). Also note that there are some flavors of Linux that like to use the KB to mean 1000 bytes, regardless of context, and this can get somewhat confusing as not all applications in the same OS will report the sizes the same. Most device makers will usually put a disclaimer somewhere on the "box" (or website etc.) to denote what they are meaning when they say KB/GB/etc, like on hard drive boxes that have the disclaimer of *1GB = 1000000000 bytes.

If you're ever confused on what style your OS is reporting to you as, you can always look at how many bytes a file is and then do the math to see what your OS is telling you (the 'size of file', not 'size on disk' as those are different things); if your OS can't tell you the raw byte count, there are bigger issues beyond what suffix it's using.

Or as Randall put it: kilobyte

  • 7
    "Most OS's and the vast majority of devices that deal with memory/storage use the prefixes K for Kilo to mean 1024 bytes" Starting with 10.6, OS X no longer does. That's a fairly significant OS. – Sören Kuklau Jul 9 '15 at 12:36
  • 2
    @Ramhound: Could you find a source for this? OS X seems to use the correct prefixes by default on my system, and I see no option to change it. There is an option to select metric or US units, but no option for using the binary prefixes. – Dietrich Epp Jul 9 '15 at 13:09
  • 1
    MacOS and some Linux distros like Ubuntu have switched to decimal prefix to make file size consistent with HDD size. KB = 1000 bytes and GB = 1000 bytes – phuclv Jul 9 '15 at 14:59
  • 4
    Hard drives are not the "exception." The "GB" on a DVD is in decimal gigabytes. Decimal prefixes are also used for tape capacities, network speeds ("gigabit Ethernet" is 1000^3 bits/s), CPU and bus clock speeds and bandwidth ratings, and in the old days, the so-called "baud rate" on serial ports. If anything, RAM is the exception with nearly every other product in the field using decimal prefixes. For some reason Windows Explorer decided to go with the JEDEC convention instead of the one used by the makers of the hard drives that contain the files Explorer is telling you about. – Jamie Hanrahan Jul 9 '15 at 19:05
  • 2
    @JamieHanrahan: Drive storage has historically used sectors with a power-of-two size, and allocation chunks that were a power-of-two number of sectors. A 360K floppy held 720 sectors of 512 bytes each; a "1.44MB" floppy was 2,880 such sectors [the "megabyte" was 1,024,000 bytes]. Only after drive capacities got larger did the megabyte shrink. – supercat Jul 9 '15 at 20:47
14

In Windows Explorer, KB means kilobyte where it refers binary kilo- of 1024 bytes. Explorer uses the capital 'K' to “indicate” binary as opposed to lower-case 'k' which is the standard kilo- prefix in SI to mean 1000.

Raymond Chen's blog post Why does Explorer use the term KB instead of KiB? gives an overview why Windows does not use KiB.

If you look around you, you'll find that nobody (to within experimental error) uses the terms kibibyte and KiB. When you buy computer memory, the amount is specified in megabytes and gigabytes, not mebibytes and gibibytes. The storage capacity printed on your blank CD is indicated in megabytes. Every document on the Internet (to within experimental error) which talks about memory and storage uses the terms kilobyte/KB, megabyte/MB, gigabyte/GB, etc. You have to go out of your way to find people who use the terms kibibyte/KiB, mebibyte/MiB, gibibyte/GiB, etc.

Explorer is just following existing practice. Everybody (to within experimental error) refers to 1024 bytes as a kilobyte, not a kibibyte. If Explorer were to switch to the term kibibyte, it would merely be showing users information in a form they cannot understand, and for what purpose?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.