Daniel Lemire's blog

, 1 min read

Bytes or octets?

Quick: what is the definition of a byte (as in two kilobytes)?

If you said it is a unit of 8 bits, you failed.

Correct answer (according to IEEE 1541):

  • A byte is a set of adjacent bits operated on as a group;
  • The octet is a set of 8 bits.

Hence, if I refer to 1024 times 8 bits, I should avoid “1 kB” as this can be interpreted as 1000 bytes where byte is a platform-specific term. I should write 1 Kio or one kibioctet. Note: Yes, I am being pedantic.

Note 2: I initially wrote “1 KB” instead of “1 kB”.