This article refers to the unit of binary information. Byte was also the name of a popular computer industry magazine, see Byte magazine.
Table of contents
The word "byte" has several meanings, all closely related:
- 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.
- 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.
- 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
charintegral data type can hold at least 8 bits (clause 18.104.22.168.1), a byte in C is at least capable of holding 256 different values (signed or unsigned
chardoesn't matter). Java's primitive
bytedata type is always defined as consisting of 8 bits and being a signed data type, holding values from -128 to 127.
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.
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 (playfully) a nibble (sometimes spelled nybble) or more formally a hex digit. The nibble is often called a semioctet in a networking or telecommunication context and also by some standards organizations.
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.
- 1 kilobyte [kB] = 1 000 (103) bytes
- 1 megabyte [MB] = 1 000 000 (106) bytes
- 1 gigabyte [GB] = 1 000 000 000 (109) bytes
- 1 terabyte [TB] = 1 000 000 000 000 (1012) bytes
- 1 petabyte [PB] = 1 000 000 000 000 000 (1015) bytes
- 1 exabyte [EB] = 1 000 000 000 000 000 000 (1018) bytes
- 1 zettabyte [ZB] = 1 000 000 000 000 000 000 000 (1021) bytes
- 1 yottabyte [YB] = 1 000 000 000 000 000 000 000 000 (1024) bytes
- 1 kibibyte [KiB] (or kilobyte (KB or kB)) = 1 024 (210) bytes
- 1 mebibyte [MiB] (or megabyte (MB)) = 1 048 576 (220) bytes
- 1 gibibyte [GiB] (or gigabyte (GB)) = 1 073 741 824 (230) bytes
- 1 tebibyte [TiB] (or terabyte (TB)) = 1 099 511 627 776 (240) bytes
- 1 pebibyte [PiB] (or petabyte (PB)) = 1 125 899 906 842 624 (250) bytes
- 1 exbibyte [EiB] (or exabyte (EB)) = 1 152 921 504 606 846 976 (260) bytes
Extending the pattern, we produce two more unofficial prefixes. These were not included in the IEC proposal, and are too large to have any realistic use in the near future.
- 1 zebibyte [ZiB] = 1 180 591 620 717 411 303 424 (270) bytes
- 1 yobibyte [YiB] = 1 208 925 819 614 629 174 706 176 (280) bytes
Note that as the magnitude increases, the proportion between the binary and decimal versions of the prefix increases.