Im trying to convert a size, lets say 244410368 bytes to xxxxxx mebibyte (MiB) but I have no idea how.
All this 1000 and 1024 bytes/bits are rather confusing.
Im trying to convert a size, lets say 244410368 bytes to xxxxxx mebibyte (MiB) but I have no idea how.
All this 1000 and 1024 bytes/bits are rather confusing.
The de-facto size for a byte is 8 bits, so to convert a number of bytes into a number of bits, just multiply by 8.
1 byte is 8 bits. http://www.google.com/search?q=1+byte+in+bits
The 1,000 vs. 1,024 thing is mega/giga/terabytes to bytes, and is indeed confusing (especially when you're talking about hard drive capacities).
Easy
244,410,368 bytes * 8 = 1,955,282,944 bits
You see, a byte is 8 bits, so multiplying it by 8 will get your answer.
See this wiki link: http://en.wikipedia.org/wiki/Byte
Now there are 8 bits in one byte..
So multiply by 8 ;)
There are 8 bits in a byte. If your units are raw bytes, you can just multiply by 8 to get bits. The 1024 numbers don't come into effect until you're dealing with prefixes. For example, a kilobyte is 1024 bytes. Wikipedia has a nice table.
So a Megabyte is 1000 * 1000 bytes, and a Mebibyte is 1024 * 1024 bytes. So to turn 244410368 bytes to MiB divide by 1048576 (1024 * 1024). I hope that helps a bit.
Also, if you want to convert MB to MiB, multiply by 1000000 and divide by 1048576. That is the difference between them.
Short story K (Kilo) in IT mean 2^10, M(Mega) is 2^20, G (Giga) is 2^30 and T (Tera) is 2^40 and so on. You can use the calculator to do this,”select scientific view, then click on Hex or Bin” type the number and then hit Dec.
Number to K divide By 2^10, K to Number multiply By 2^10
Number to M divide By 2^20, M to Number multiply By 2^20
Number to G divide By 2^30, G to Number multiply By 2^30
Number to T divide By 2^40, T to Number multiply By 2^40
Bit to Byte divide By 8, Byte to Bit multiply By 8
This should be valid for edited question:
1MiB = 1024*1024 B, so:
244410368 B = 244410368 / (1024 * 1024) MiB, so:
244410368 B = ~233 MiB
(please do not edit your questions in such way to change totally their meaning, this is confusing and now all previously good answers are not valid, you can close (or just leave) question and ask another one)
Although unit conversion isn't terribly complicated math, reducing the number of hard-coded numbers and shell-scripting the idea (rather than the computation) may be desireable. If your linux system has the units
program, you can do unit conversions like this:
% units --terse "244410368 bytes" "MiB"
233.08789
% units --terse "244410368 bytes" "MB"
244.41037
(On Ubuntu, the units
program is provided by the (surprise!) units
package.)
8 bits = 1 byte 1024 bytes = 1 KB 1024 KB = 1 MB 1024 MB = 1 GB
So 1 GB = 1024*1024*1024*8 bits.