Digital Information Sizes Calculator

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.

100 2-3
103 210
106 220
109 230
1012 240
1015 250
1018 260

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.

The calculator can be pre-seeded with values through URL parameters (example).
Pressing the ‘↥’ symbol after an input field (if available) will put a URL for that value into the clipboard.
Supported parameters:

  • value: any valid size specification like “3.5TiB” or “1024 bytes”. The unit for number of sectors is ‘sect’.
  • sector: the sector size in bytes.
  • round: no, values, or up.

◆ Other calculators: TimeVideo bitrate

Why Can “Megabyte” Mean Two Different Things?

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:

Full notationSymbolValue
1 kilobyte1 kB103 = 1000 bytes
1 megabyte1 MB106 = 1000000 bytes
1 gigabyte1 GB109 = 1000000000 bytes
1 terabyte1 TB1012 = 1000000000000 bytes
1 petabyte1 PB1015 = 1000000000000000 bytes
1 kibibyte1 KiB210 = 1024 bytes
1 mebibyte1 MiB220 = 1048576 bytes
1 gibibyte1 GiB230 = 1073741824 bytes
1 tebibyte1 TiB240 = 1099511627776 bytes
1 pebibyte1 PiB250 = 1125899906842624 bytes

The big problem is that even 20 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 an 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?

©2010-2023 Alexander Thomas