This calculator converts between the SI units for digital information sizes where the prefix represents a power of ten (kB, MB), and the IEC units where the prefix represents a power of two (KiB, MiB).
Type a value in any of the boxes and either hit the Enter key, press “Update,” or click/touch anywhere outside the input field to update the other values.
The powers of 10 and 2 next to the input boxes are multipliers to obtain the number of bytes.
Check “Round Values” to round all numbers to 2 digits after the decimal point. Check “Round Up” as well to round every number up to the smallest integer that is large enough to contain the actual value.
In case you are wondering: yes, two larger units after exabyte (exbibyte) exist. They are the ‘zettabyte’ (‘zebibyte’) and ‘yottabyte’ (yobibyte) respectively.
Until the year 2000, when someone said
one megabyte, in nearly all cases an actual value of 220, or 1048576 bytes was meant. There was a valid reason why these weird units were used. Especially in early computer systems, memory and hard disk sizes were often exact multiples of powers of two due to the way the underlying hardware was constructed. Because 210 = 1024, pretty close to 1000, 1024 bytes were referred to as a ‘kilobyte’ and similarly for ‘megabyte’ etc.
For the average user however the relevance of units tailored to grids of memory cells is null. Only when one buys a RAM module nowadays it will still have a size that is closely related to some power of two. Most other storage media have completely arbitrary sizes. This would not be problematic if it weren't for two major drawbacks of those units based on powers of two. First, they are cumbersome to work with for humans who have learnt to count in a 10-based system. How many Mebibytes fit in 1.78 Tebibytes? Use the calculator above and you'll see the answer is not the expected 1780000. Second and related, the ‘kilo’, ‘mega’, etc. prefixes conflict with the standard SI system where “one megaWatt” means 106, or 1000000 Watts. As the multipliers become larger, so does the discrepancy between their meaning in the SI system and the system based on powers of two.
To avoid confusion, in the year 2000 the IEC proposed a custom naming and notation scheme for the 2-based units. The new names were created by replacing the second syllable in the old name by ‘bi’ (referring to ‘two’). Therefore an old ‘kilobyte’ is now a ‘kibibyte’ and so on. The new (or rather old) units also got corresponding symbols, so ‘10 kibibyte’ is now written as ‘10 KiB’ instead of ‘10 kB’. The following table shows how the values differ for the two systems:
|1 kilobyte||1 kB||103 = 1000 bytes|
|1 megabyte||1 MB||106 = 1000000 bytes|
|1 gigabyte||1 GB||109 = 1000000000 bytes|
|1 terabyte||1 TB||1012 = 1000000000000 bytes|
|1 petabyte||1 PB||1015 = 1000000000000000 bytes|
|1 kibibyte||1 KiB||210 = 1024 bytes|
|1 mebibyte||1 MiB||220 = 1048576 bytes|
|1 gibibyte||1 GiB||230 = 1073741824 bytes|
|1 tebibyte||1 TiB||240 = 1099511627776 bytes|
|1 pebibyte||1 PiB||250 = 1125899906842624 bytes|
The big problem is that even ten years later a lot of software and many people still refer to the base-2 units with their SI names. We seem to be stuck in a transition period where “megabyte” can mean either 1000000 bytes or 1048576 bytes. Due to the larger discrepancy between the SI and IEC units as they become bigger, the confusion also becomes bigger as hard drives become bigger. A gibibyte is 7.4% larger than a gigabyte and a tebibyte is 10% larger than a terabyte, which is pretty significant. Many people have complained that they bought a 250GB hard drive and their operating system only reported the drive as having a capacity of “232GB.” The manufacturers of the drive are not to blame and this is not
a lame marketing trick to make the drive seem bigger or
a conspiracy. They really bought a 250 gigabyte drive, which is equivalent to a 232 gibibyte drive. Their operating system is to blame because it uses the wrong notation.
Some drive manufacturers try to hide this issue by putting silly disclaimers on their products that state
actual formatted capacity may be less. True, some space is lost due to formatting but it is never in the order of 7.4%. If someone would sue a vendor of hard disks for misleading information they would lose the case anyway, because the definition of “giga” being 109 is an international standard while “giga = 230” is nothing more than a convention.
Apple Inc. was the first major OS vendor to take the brave but logical step to switch to the much more convenient SI units for all(1) their software, with the release of Mac OS X 10.6 aka “Snow Leopard.” Unfortunately at the time of this writing Microsoft Windows still adheres to the base-2 units without using the proper IEC naming, which is confusing and annoying. Linux, thanks to its open-source nature has a mix of everything which makes it a must to (re-)read manual pages thoroughly before using any low-level tool. Some of those manual pages include near-religious arguments to justify their usage of 2-based units without the IEC naming scheme. This strikes me as highly unprofessional. For utilities that can potentially destroy your filesystem when given arguments that are just 2.4% off, clarity is essential.
I hereby urge all software makers, from the largest companies to the smallest hobbyists, to switch to the 10-based SI units. If there is a good reason to stick to the 2-based units, make sure that they are correctly named and displayed with their ‘KiB’, ‘MiB’ etc. symbols. To keep everyone happy you could provide an option in your software to use either SI or IEC units. And please, never use the capital ‘K’ to denote either ‘kilo’ or ‘kibi’: I cannot figure out one single good use for a “Kelvinbyte”(2).
The fact that the names of the IEC units “sound silly” and that you have fond memories of growing up with powers of two are not good reasons to stick to the 2-based units while disguising them as SI units. If you don't like the sound of names like ‘gibibyte’, feel free to use something else that cannot be confused with an actual megabyte, e.g. “binary megabyte”(3). There are in fact very few reasons to stick to the 2-based units at all, even when accompanied by the right symbols. They are cumbersome to work with for most practical uses. Nostalgy is not a good reason. The fact that one megabyte is “almost” the same as one mebibyte is not a good reason. The fact that SI units sound “elitist” is not a good reason. There is nothing elitist or
politically correct about trying to get rid of useless sources of confusion and errors. This has nothing to do with subjective stuff like language or culture, it is about plain hard numbers. Numbers do not give a damn about your emotional attachment to 2n-based units.
Just imagine that you go to a hardware store and buy several wooden beams 10 ‘units’ long because this makes them fit exactly inside whatever you are building. When you come home, you notice that the beams do not fit at all because they are 7% longer than expected. You spend some of your precious time shortening the beams and notice you bought one too few. The next day you go to another store because the first one is on a vacation break. This time you try to be smart and buy a beam of 9.3 ‘units’. You come home and notice the beam is 7% shorter than you had hoped, and leaves an ugly gap. This inconvenient scenario never happens in reality because units of length are well defined and follow the same rules for subdivision as most other units. Why should it not be the same for units of information?
(1): Actually, ‘most’ of their software. At the time of this writing, iTunes for instance still uses 2-based units with SI names.
(2): Why the discrepancy between “k” and “Ki”? The IEC could have used “ki” to maintain consistency with the SI unit notation, where unlike the rest of the capital letters (M, G, T, …), the ‘k’ obviously had to be lowercase due to the possible confusion with Kelvin. But since the IEC units were a fresh start anyway, it made more sense to maintain consistency within this new notation system and start every suffix with a capital.
(3): I don't like Donald Knuth's proposal of
large megabyte because it is vague. How large?