# Why does `df` use “Bi” as abbreviation for bytes?

Apparently `df` is putting "i" after capital letters for each size. This makes sense for Kilobytes/Kibibytes, Gigabytes/Gibibytes, and Mebibytes (if that's what "Mi" stands for). But why would it use "Bi" for bytes?

For example, part of my result of `df -h` is:

``````map auto_home           0Bi    0Bi    0Bi   100%       0          0  100%   /home
``````
• What are the results of `df -H`? RTM- the `h` option output is base 2 and the `H` option output is base 10. – fd0 Oct 19 '17 at 15:51

## 2 Answers

It's the difference between the decimal value and the binary prefix. In this case, it's saying you are using 0 binary bytes.

What's the difference?

Using "Giga" as our example, it means 10003 of something (i.e. Gigahertz).

In computers it poses an interesting problem:

A Gigabyte is 10003 bytes. However a byte is 8 (binary) bits. Which means it's technically 10243 bytes. To account for this, we use different notation:

• Giga is decimal (base 10)
• Gibi is binary (base 2)

The output is telling you that it's using binary units.

If you want to get the output in "human readable decimal notation", use a capital "H":

``````\$ df -H
/dev/disk2      1.1T   413G   706G    37% 100935848 172431606   37%
map auto_home     0B     0B     0B   100%         0         0  100%   /home
``````

Finally, it's actually not an Apple convention, but one from BSD (it's a BSD command). You can find more info on the man page (`man df`).

• I do not understand how this answers the question. OP makes it clear that they know the difference between `1GB` and `1GiB`. The question is: what is the difference between `1Bi` and `1B`? Why two different symbols? – Federico Poloni Oct 19 '17 at 17:35
• "A Gigabyte is 1000^3 bytes. However a byte is 8 (binary) bits. Which means it's technically 1024^3 bytes." - I don't see how a byte being 8 bits leads to gigabyte meaning 1024^3 instead of 1000^3... – marcelm Oct 19 '17 at 17:52
• @marcelm Gigabyte = 1024 megabytes. Megabyte = 1024 kilobytes. Kilobyte = 1024 bytes. 1024 = 2^10. – Dmitry Kudriavtsev Oct 19 '17 at 18:07
• @marcelm You're correct, that's a non-sequitur. Memory (RAM) has always been measured as multiples of powers of 2, due to how chips are manufactured. Space on spinning disks is not necessarily, because it depends on physical surface area and bit density, so disk makers chose to use even powers of 1000 to make the numbers on their box look better. "Gibi" and similar prefixes were a retroactive creation to try to distinguish between them, but clearly they only make things more messy. – BradC Oct 19 '17 at 18:12
• The real reason why the decimal prefix was used for 2^x numbers in the earlier days is: 2^10~10^3. – klanomath Oct 19 '17 at 19:51

Bi means you're in units of 10240 bytes, instead of 10000 bytes.

i.e. they're the same unit, but wouldn't be with larger prefixes that mean non-zero exponents. It looks like `df` is just being pedantic, as a way to be consistent when in power-of-2 units mode.

This is a made-up convention: there is no metric or IEC "Bi" unit, only 2-letter IEC prefixes that end with "i", for use with quantities of bits or bytes. (e.g. Mi for mebibytes or mebibits.) And no, you're not expected to ever say that out loud un-ironically with a straight face.

"iB" might make more sense (binary bytes with no prefix), but it's not a thing either.

• Then shouldn't it be "iB"? ;) – Cai Oct 20 '17 at 10:31
• 1024^0 is exactly equal to 1000^0 ( = 1 ) so it doesn't explain it. There's no term/symbol to indicate binary byte (because byte inherently implies binary) so I used giga as an example. It's even more difficult to indicate 0 because 0 in binary and 0 in decimal are equal and can be confusing. – Allan Oct 20 '17 at 10:40
• @Cai: I checked, the IEC prefixes always include the "i" with the prefix, and make no mention of an "iB" base unit. See updated answer. But yes, agreed that would be more consistent. Of course, in this context (FreeBSD / OS X `df` output), that's what it means. – Peter Cordes Oct 20 '17 at 10:43
• Maybe iB are imaginary bytes? – Federico Poloni Oct 20 '17 at 14:03