A byte is commonly used as a unit of storage measurement in computers. It is one of the basic integral data types in computing. The byte is often used to specify the size or amount of computer memory or storage, regardless of the type of data stored in it. Such numbers can get very large, which lead to the use of prefixes.
A byte has several meanings, all closely related:
- A contiguous sequence of a fixed number of bits. On modern computers, an 8-bit byte is by far the most common. Certain older models have used 6-, 7-, or 9-bit bytes -- for instance on the 36-bit architecture of the PDP-10. A byte is always atomic on the system, meaning that it is the smallest addressable unit. An 8-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 an extended ASCII character.
- 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 assembler 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 in certain programming languages. C for example defines byte to be synonymous with unsigned char -- an integer datatype capable of holding at least 256 different values.
The 8-bit byte is often called an octet in formal contexts such as industry standards, as well as in networking. This is also the word used for the 8-bit quantity in many non-English languages, where the pun on "bite" does not translate.
Half a byte (4 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 context and also by some standards organisations.
As a unit of measure, bytes is abbreviated as B; hence MB for megabytes. Likewise, the lowercase b is used for bits: hence, a 5Mb/s network segment carries 5 megabits per second, while a 90GB hard drive carries 90 gigabytes. Computer memory and storage are usually denominated in bytes, while network speed is denominated in bits, and parallel bus speed in Hertz.
Standards organizations have proposed binary prefixes for the powers of 2 often used as multiples of bytes -- e.g. mebibyte rather than megabyte for 220 bytes -- but these have not caught on in common usage.
A comparitive table of base 10 and base 2 Bytes
- 1 Kilobyte [kB] = 1000 (103) Byte
- 1 Megabyte [MB] = 1 000 000 (106) Byte
- 1 Gigabyte [GB] = 1 000 000 000 (109) Byte
- 1 Terabyte [TB] = 1 000 000 000 000 (1012) Byte
- 1 Petabyte [PB] = 1 000 000 000 000 000 (1015) Byte
- 1 Kibibyte [KiB] = 1024 (210) Byte
- 1 Mebibyte [MiB] = 1 048 576 (220) Byte
- 1 Gibibyte [GiB] = 1 073 741 824 (230) Byte
- 1 Tebibyte [TiB] = 1 099 511 627 776 (240) Byte
- 1 Pebibyte [PiB] = 1 125 899 906 842 624 (250) Byte
Byte was also the name of a popular computer industry magazine, see Byte magazine.