Byte

For the computer industry magazine, see Byte magazine.
Multiples of bytes
as defined by IEC 60027-2
SI prefix   Binary prefixes
NameSymbolMultiple NameSymbolMultiple
kilobytekB103 kibibyteKiB (or KB)210
megabyteMB106 (or 220) mebibyteMiB220
gigabyteGB109 (or 230) gibibyteGiB230
terabyteTB1012 (or 240) tebibyteTiB240
petabytePB1015 (or 250) pebibytePiB250
exabyteEB1018 (or 260) exbibyteEiB260
zettabyteZB1021 (or 270) zebibyteZiB270
yottabyteYB1024 (or 280) yobibyteYiB280

A byte is commonly used as a unit of storage measurement in computers, regardless of the type of data being stored. It is also one of the basic integral data types in many programming languages.

Contents

Meanings

The word "byte" has several meanings, all closely related:

  1. A contiguous sequence of a fixed number of bits. On modern computers, an eight-bit byte or octet is by far the most common. This was not always the case. Certain older models have used six-, seven-, or nine-bit bytes - for instance on the 36-bit architecture of the PDP-10. Another example of a non eight-bit sequence is the 12-bit slab of the NCR-315. A byte is always atomic on the system, meaning that it is the smallest addressable unit. An eight-bit byte can hold 256 possible values (28 = 256) -- enough to store an unsigned integer ranging from 0 to 255, a signed integer from -128 to 127, or a character of a seven-bit (such as ASCII) or eight-bit character encoding.
  2. A contiguous sequence of bits that comprises a sub-field of a longer sequence known as a word. On some computers it is possible to address bytes of arbitrary length. This usage is reflected, for example, in LDB and DPB assembly instructions for field extraction on a PDP-10, which survive as bytewise operations in Common Lisp; and in the six-bit bytes of the IBM 1401.
  3. A datatype or synonym for a datatype in certain programming languages. C, for example, defines byte as a storage unit capable of at least being large enough to hold any character of the execution environment (clause 3.5 of the C standard). Since the C char integral data type can hold at least 8 bits (clause 5.2.4.2.1), a byte in C is at least capable of holding 256 different values (signed or unsigned char doesn't matter). Java's primitive byte data type is always defined as consisting of 8 bits and being a signed data type, holding values from -128 to 127.

Coined

The term byte was coined by Werner Buchholz in 1956 during the early design phase for the IBM Stretch computer. Originally it was described as one to six bits; typical I/O equipment of the period used six-bit units. The move to an eight-bit byte happened in late 1956, and this size was later adopted and promulgated as a standard by the System/360. The word was coined by mutating the word bite so it would not be accidentally misspelled as bit.

Alternate words

The eight-bit byte is often called an octet in formal contexts such as industry standards, as well as in networking and telecommunication. This is also the word used for the eight-bit quantity in many non-English languages, where the pun on bite does not translate.

Half of an eight-bit byte (four bits) is sometimes called a nibble (sometimes spelled nybble) or a hex digit. The nibble is often called a semioctet in a networking or telecommunication context and also by some standards organizations.

Abbreviation

"Byte" is most often abbreviated as "B", hence "MB" for "megabyte".

Sometimes "b" is used for byte (and "bit" for bit), but this can cause confusion because of the much more common use of "b" to mean bit.

French-speaking countries sometimes use "o" for "octet". This is also unacceptable in SI because of the risk of confusion with the zero.

Names for larger units

Note: the names "kilobyte", "megabyte", etc. may be used to mean either the SI or binary multipliers. For further discussion, see Binary prefix.ar:بايت ca:Byte cs:Byte da:Byte de:Byte et:Bait es:Byte eo:Bitoko fr:Octet gl:Byte ko:바이트 hr:Bajt id:Byte it:Byte he:בית (מחשב) lt:Baitas hu:Bájt ms:Bait nl:Byte ja:バイト (情報) no:Byte pl:Bajt (informatyka) pt:Byte ro:Octet ru:Байт sk:Bajt sl:Bajt fi:Tavu (tietotekniikka) sv:Byte (enhet) th:ไบต์ vi:Byte zh:字节