MB, MiB, GB, GiB, what the differences are and why it causes confusion

Posted by under Rants, Servers, on 5 February 2012 @ 7:50pm.

OK so you’ve probably heard of MB and GB (MegaBytes and GigaBytes), they’re used on all sorts of devices from phones to computers. But what are they? Better still, what are MiB and GiB (MibiBytes and GibiBytes)? Well both are units for measuring memory size but they have differences. The difference is that one is calculated using base 2 and one is calculated using base 10.

For these examples we’ll stick to GigaBytes and GibiBytes for our sizes.

A GigaByte that we’re all so used to is base 10 (1,000,000,000 bytes to 1 Gigabyte).
A GibiByte that you may have heard of is in base 2 (1,073,741,824 bytes to 1 GibiByte).

gib-vs-gb-table
Table taken from http://www.pcguide.com/intro/fun/bindec.htm

So why does it cause confusion? Several reasons. Most sizes are referred to in Mega or Giga bytes so many people have been accustomed to this. For example in magazines or advertisements selling electronic equipment (tablet’s, digital cameras, etc.) and computers running Windows they’re referred to as this, but that’s where the confusion comes in, and a bit of a rant because of it.

The difference between 1GiB and 1GB is marginal, but when you increase this to several tens or thousands, it throws the scale way off. Not only that, Windows runs in base 2, but actually displays it using the prefix for base 10. So when you think it’s 1 GigaByte it’s actually showing 1 GibiByte instead but with the wrong unit! I have no idea why Microsoft decided to do this but it’s confusing as hell when you’re trying to work out the differences in file size on a program that really does show it properly. Gah!

The problem I had recently was on one of my sites, BetaArchive. I was trying to find discrepancies in the total archive size counter. It wasn’t showing the right size but we were adamant we had it right. In the end it turned out to be in the units.

Now I believe Mac and Linux use GigaBytes correctly and are also switchable from what I have read, you just have to find the option for it so Windows should have no excuse getting it right. Many people have complained to Microsoft but they’ve never done anything about it for some reason, so this problem continues to plague developers and people like myself trying to work out these discrepancies.

Suffice to say I wasted 2 hours trying to figure out where the missing data was. As a result of this cock-up I’ve even had to put a message next on the display on BetaArchive so people know it’s actually showing the right unit on the site but Windows shows the wrong unit!

I don’t doubt this will plague people for years to come as I doubt it will be fixed in Windows 8 either. I just find it hard to believe Microsoft have got away with it for this long.