This question got me wondering about the differences between these three ways of measuring size: a kibibyte, a kilobit, and the conventional kilobyte.

I understand that these measurements have different uses (data transfer rate is measured in bits/sec), but I'm not quite sure if I can tell the difference between Mb and MB and MiB.

Here is a comment, reproduced below, taken from this answer (emphasis mine).

The C64 has 65536 bytes of RAM. By convention, memory size is specified in kibiBytes, data transfer rates in kilobits, and mass storage in whatever-the-manufacturers-think-of-now-Bytes. Harddrives use T, G, M and k on the label, Windows reports the size in Ti, Gi, Mi and ki. And those 1.44MB floppys? Those are neither 1.44MB nor 1.44MiB, they are 1.44 kilokibibytes. That's 1440kiB or 1'474'560 bytes. – Third

link|improve this question

77% accept rate
2  
There will be confusion for years to come. In the early days of computing, people spotted that it was clearly much easier to work with factors of 1024 rather than 1000 for computers. Therefore, for decades, the standard SI prefix "kilo" was (and still very often is) used for the non-standard 1024, and it became a de-facto standard in computing. Except that some people still used the SI 1000 anyway. To sort out the mess, "kibi" is now officially defined as a 1024 factor - but it came far too late for an easy transition. "kilo" will be regularly used/abused for 1024 factors for a while yet. – Steve314 Nov 15 '11 at 6:46
feedback

2 Answers

up vote 22 down vote accepted
1 KiB (Kibibyte) = 1,024 B (Bytes) (2^10 Bytes)
1 kb  (Kilobit)  =   125 B (Bytes) (10^3 Bits ÷ (8 bits / byte) = 125 B)
1 kB  (Kilobyte) = 1,000 B (Bytes) (10^3 Bytes)

It's the same way with any SI prefix; k (1x103), M (1x106), G (1x109), so, by extension:

1 MiB (Mebibyte) = 1,048,576 B (Bytes) (2^20 Bytes)
1 Mb  (Megabit)  =   125,000 B (Bytes) (10^6 Bits ÷ (8 bits / byte) = 125,000 B)
1 MB  (Megabyte) = 1,000,000 B (Bytes) (10^6 Bytes)

The only ones that are a bit different are the IEC Binary Prefixes (kibi/mebi/gibi etc.), because they are in base 2, not base 10 (e.g. all numbers equal 2something instead of 10something). I prefer to just use the SI prefixes because I find it to be a lot easier. Plus, Canada (my country) uses the metric system, so I'm used to, for instance 1kg = 1000g (or 1k anything = 1000 base things). None of these are wrong or right; just make sure you know which one you're using and what it really equates to.

To appease the commenters:

1 Byte (B) = 2 nibbles = 8 bits (b)

This is why, if you've ever taken a look in a hex editor, everything is split into two hexadecimal characters; each hex character is the size of a nibble, and there are two to a byte. For instance:

198 (decimal) = C6 (hex) = 11000110 (bits)
link|improve this answer
3  
+1 Mentioning that there are 8 bits in a byte may be useful. – paradroid May 23 '11 at 15:52
@paradroid Done, thanks! – squircle May 23 '11 at 15:53
3  
Might also be aware that the lowercase "b" is sometimes used incorrectly to abbreviate "bytes". I see a lot of places just use "bit" in the abreviation such at MB for megabyte and Mbit for megabit and stay away from "b" altogether. – James May 23 '11 at 16:02
3  
The prefix kilo is abbreviated k, not K. – garyjohn May 23 '11 at 16:19
1  
@Redandwhite Nope, they use base 10 to measure their storage, but our computers use base 2. This accounts for the discrepancy between what's printed on the box and what shows up in the computer. For example, 500GB (box) = 465.7GiB (computer) (and that is how they get you). – squircle May 23 '11 at 16:36
show 10 more comments
feedback

enter image description here

link|improve this answer
+1 for XKCD comic – Darius May 23 '11 at 21:33
+1 for reminding me of Stan Kelly-Bootle. – RedGrittyBrick May 23 '11 at 22:08
11  
Funny, and I love xkcd as much as the next nerd, but -1 because it doesn't actually answer the question, and in fact has incorrect info for some of the abbreviations. – nhinkle May 23 '11 at 23:13
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.