1 kilobyte is precisely 1000 bytes
Published on
Updated on
When it comes to computer memory, we usually learn that a kilobyte is 1024 bytes, a megabyte is 1024 kilobytes, and so on. But what if I told you that actually 1000 bytes makes more sense.
Why do we often say 1 kilobyte = 1024 bytes?
Since computers normally work in a binary system (base 2), the memory is also addressed in binary. This (and additional technical reasons, such as conforming to standard memory bus widths) means it's quite impractical to produce RAM sticks with memory amounts that are not powers of 2. From the powers of 2 we chose 1024 (210) as the base order of magnitude, since it's very close to 1000 (2.4% difference) and it's not insanely large. So, in practice we often consider kilo as 1024 (210), mega as 1048576 (220), giga as 1073741824 (230), etc.
Why does 1000 still make more sense?
While binary kilo, mega and giga units are close to their decimal counterparts, some might already notice that the larger are the units, the more is the proportional inaccuracy. In order to illustrate the problem, let's increase the units:
| Unit | Decimal value | Binary value | Relative difference |
|---|---|---|---|
| Kilo | 1000 | 1024 | 2.4% |
| Mega | 1000000 | 1048576 | ≈ 4.8% |
| Giga | 1000000000 | 1073741824 | ≈ 7.3% |
| Tera | 1000000000000 | 1099511627776 | ≈ 10% |
| Peta | 1015 | ~ 1.126 * 1015 | ≈ 12.6% |
| Exa | 1018 | ~ 1.153 * 1018 | ≈ 15.3% |
| Zetta | 1021 | ~ 1.181 * 1021 | ≈ 18.1% |
| Yotta | 1024 | ~ 1.209 * 1024 | ≈ 20.9% |
| Ronna | 1027 | ~ 1.238 * 1027 | ≈ 23.8% |
| Quetta | 1030 | ~ 1.268 * 1030 | ≈ 26.8% |
For 1 quettabyte the inaccuracy is already larger than a quarter. Even for 1 terabyte the difference is noticeable, around 10%. This problem often happens when hardware manufacturers (such as HDD or SSD) advertise the memory capacity in decimal units while the operating system might show in binary units.
For smaller amounts of memory the binary representation is pretty close to the decimal one, but diverges for huge amounts of memory.
What are the standard units?
This "kilobyte = 1024 bytes" rule is actually an old (often confusing) convention. In the tech industry there is still huge inertia, this old convention is still used by RAM manufacturers (JEDEC), tons of software and some operating systems (such as Windows). Interestingly, storage vendors often prefer the decimal convention, which creates even more confusion (mentioned above).
The problem is that in International System of Units kilo literally means 1000, mega literally means 1000000, etc. Using such prefixes with slightly different meanings, and what's worse, using them inconsistently, is not a good thing. In order to solve this confusion, International Electrotechnical Commission introduced binary prefixes for binary units:
| Binary units (International Electrotechnical Commission) | Decimal units (International System of Units) | ||
|---|---|---|---|
| Unit | Value | Unit | Value |
| KiB (kibibyte) | 10241 | kB (kilobyte) | 10001 |
| MiB (mebibyte) | 10242 | MB (megabyte) | 10002 |
| GiB (gibibyte) | 10243 | GB (gigabyte) | 10003 |
| TiB (tebibyte) | 10244 | TB (terabyte) | 10004 |
| PiB (pebibyte) | 10245 | PB (petabyte) | 10005 |
| EiB (exbibyte) | 10246 | EB (exabyte) | 10006 |
| ZiB (zebibyte) | 10247 | ZB (zettabyte) | 10007 |
| YiB (yobibyte) | 10248 | YB (yottabyte) | 10008 |
| RiB (robibyte) | 10249 | RB (ronnabyte) | 10009 |
| QiB (quebibyte) | 102410 | QB (quettabyte) | 100010 |
The guidance is: SI prefixes are powers of 10 only, and if you mean powers of 2 you should use IEC binary prefixes (Ki, Mi, Gi, …).
Conclusion
There is still a lot of inertia to equate 1 kilobyte to 1024 bytes. While this is usually acceptable depending on the context, it can sometimes cause confusion, especially for non-technical people. In the end, it's important to be aware of the difference between binary and decimal systems and stick to the appropriate prefixes, especially when writing a documentation or designing and application that shows memory amounts.