Of Zen and Computing

How to Convert Between Bytes, Kilobytes, Megabytes, Gigabytes, and so on…

Monday, August 11, 2008

Various units of measurement such as kilobyte, megabyte, and gigabyte are often used to describe the sizes of digital files. What do these mean, and how do you convert between them? A bit of simple math will do the trick.

The smallest unit of measurement in computer science is a bit, which has the value of either 0 or 1. Starting from there, we get…

  • Byte: 8 bits
  • Kilobyte: 1,024 bytes
  • Megabyte: 1,024 KB
  • Gigabyte: 1,024 MB
  • Terabyte: 1,024 GB

After terabyte comes petabyte, exabyte, zettabyte, and yottabyte.

This information makes it much easier to visualize the answers to questions such as “how many megabytes are in a 5 gigabyte file?” Since a gigabyte is 1,024 megabytes, and we have 5 gigabytes, 1,024 multiplied by 5 gives us 5,125 megabytes in 5 gigabytes.

How many megabytes is an 8,704 kilobyte file? Since there are 1,024 kilobytes in one megabyte, we divide 8,704 by 1,024 to get 8.5 megabytes.

Editor’s note: The whole gigabyte/gibibyte discussion is beyond the scope of this article. I am using decimal prefixes to discuss binary math as awareness of the IEC’s binary prefixes is not widespread among casual computer users. For the sake of correctness, this article’s language sticks to discussion of file sizes and makes no mention of storage or networking.

File under: Computer Science

Digg icon StumbleUpon icon del.icio.us icon Facebook icon

Other articles related to this page

© 2006-2008 OfZenAndComputing.com
E-mail Disclaimer | Terms of Service & Disclaimer | Sitemap

Subscription Options
Search Our Archive of How-To Articles and Blog Posts