Home » Programming / Coding

Byte Conversion Formula

4 January 2011 3,182 views No Comment

This might be confusing for some people converting bytes for storage media etc.

Here are the basics:

1 byte = 8 bits
1 kilobyte (K / Kb) = 2^10 bytes = 1,024 bytes
1 megabyte (M / MB) = 2^20 bytes = 1,048,576 bytes
1 gigabyte (G / GB) = 2^30 bytes = 1,073,741,824 bytes
1 terabyte (T / TB) = 2^40 bytes = 1,099,511,627,776 bytes
1 petabyte (P / PB) = 2^50 bytes = 1,125,899,906,842,624 bytes
1 exabyte (E / EB) = 2^60 bytes = 1,152,921,504,606,846,976 bytes

So the formula for conversion are:
X KB = NumberOfBytes/1024
X MB = NumberOfBytes/1048576 OR X MB = NumberOfBytes/1024/1024

_______________

From Webcosmo Webmaster Forum http://www.webcosmoforums.com/web-development-programming-coding/25107-byte-conversion-formula.html

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.