Converting bytes to megabytes

User1 picture User1 · Mar 2, 2010 · Viewed 166.1k times · Source

I've seen three ways of doing conversion from bytes to megabytes:

  1. megabytes=bytes/1000000
  2. megabytes=bytes/1024/1024
  3. megabytes=bytes/1024/1000

Ok, I think #3 is totally wrong but I have seen it. I think #2 is right, but I am looking for some respected authority (like W3C, ISO, NIST, etc) to clarify which megabyte is a true megabyte. Can anyone cite a source that explicitly explains how this calculation is done?

Bonus question: if #2 is a megabyte what are #1 and #3 called?

BTW: Hard drive manufacturers don't count as authorities on this one!

Answer

Andrey picture Andrey · Mar 2, 2010

Traditionally by megabyte we mean your second option -- 1 megabyte = 220 bytes. But it is not correct actually because mega means 1 000 000. There is a new standard name for 220 bytes, it is mebibyte (http://en.wikipedia.org/wiki/Mebibyte) and it gathers popularity.