Search topics and sections

A byte is a unit of digital information that today almost always means eight bits. A bit is a single 0 or 1, so one byte can hold 256 different patterns, which is enough to stand for any English letter, digit, or common punctuation mark.[1]

Computers store and measure data in bytes. In most computers, each byte in memory has its own number, called an address, that a program uses to find it.[1] File sizes, memory, and disk space are measured in bytes and in larger units such as the Kilobyte, Megabyte, and Gigabyte.

Bits make a byte

A byte is a group of bits handled as one unit.[1] Because each bit has two possible values, adding a bit doubles the number of patterns a group can hold.[2]

N=2nN = 2^n

Here nn is the number of bits and NN is the number of different patterns they can form. For a byte, n=8n = 8, so N=28=256N = 2^8 = 256.[2]

Read as a whole number in binary, a byte holds any value from 0 to 255. One pattern (all zeros) stands for 0, which leaves 255 patterns for the positive values 1 to 255.[2]

Anatomy of a byte 0100 1011 128643216 8421 high-order bit low-order bit nibble: 0100 = 4 nibble: 1011 = B hexadecimal 0x4B = decimal 75 = ASCII letter K
One byte holds eight bits with place values from 128 down to 1. The bits 01001011 split into the nibbles 0100=40100 = 4 and 1011=B1011 = \text{B}, giving 0x4B=64+8+2+1=75\text{0x4B} = 64 + 8 + 2 + 1 = 75, the code for the letter K in ASCII, a standard character code.

High-order and low-order bits

Each bit position has a place value, from 128 for the leftmost bit down to 1 for the rightmost. The leftmost bit, worth the most, is the most significant or high-order bit. The rightmost, worth 1, is the least significant or low-order bit.[3]

Nibbles and hexadecimal

Half a byte, four bits, is called a Nibble (also spelled nybble).[4] Four bits make 24=162^4 = 16 patterns, which is exactly the number of digits in Hexadecimal, so one hexadecimal digit stands for one nibble.[2][4]

This makes hexadecimal a short way to write bytes. Every byte is written as two hexadecimal digits, from 00 to FF. For example, the byte 01001011 splits into the nibbles 0100 and 1011, which are 4 and B, so it is written 0x4B (75 in decimal), where the prefix 0x marks a hexadecimal number.[2]

What a byte holds

A byte has no meaning on its own. The same eight bits can stand for a letter, a number, or part of a larger value, depending on how a program reads them.

  • Text. A character encoding maps each character to a bit pattern. The 7-bit ASCII code fits in one byte with the high-order bit set to 0.[5] UTF-8 uses 1 to 4 bytes per character, and it stores every ASCII character in a single byte with its usual value.[6]
  • Numbers. One byte holds a whole number from 0 to 255. Larger numbers take several bytes in a row.[2][7]
  • Memory locations. In most computers the byte is the smallest unit of memory that has its own address. A program cannot ask for fewer than eight bits of memory.[1]

Symbols and multiples

The byte has the symbol B, and the bit has the symbol bit.[8][9]

The standard IEC 80000-13 warns that the symbol B for byte is not international. It must not be confused with B for the bel, a unit of sound level.[9]

Decimal and binary prefixes

Large amounts of data use prefixes. The metric prefixes count in powers of 1000, while the binary prefixes count in powers of 1024 (2102^{10}).[8]

Decimal unit Size in bytes Binary unit Size in bytes
kilobyte (kB) 10310^3 = 1000 kibibyte (KiB) 2102^{10} = 1024
megabyte (MB) 10610^6 = 1 000 000 mebibyte (MiB) 2202^{20} = 1 048 576
gigabyte (GB) 10910^9 = 1 000 000 000 gibibyte (GiB) 2302^{30} = 1 073 741 824
terabyte (TB) 101210^{12} tebibyte (TiB) 2402^{40}

The International Electrotechnical Commission (IEC) approved the binary prefixes in December 1998. They are not part of the International System of Units (SI), though their names come from the SI prefixes.[8]

Why the two systems clash

The confusion began because 2102^{10} = 1024 is close to 1000. Computer engineers started calling 1024 bytes a kilobyte because it was easier, and the habit spread to the public.[10]

As a result, the word megabyte has more than one meaning.[8]

Context Meaning of megabyte Size in bytes
Most memory makers 2202^{20} bytes 1 048 576
Most storage-device makers 10610^6 bytes 1 000 000
"1.44 MB" 3.5-inch floppy disk 1000 × 1024 bytes 1 024 000

The gap grows with each prefix. It is 2.4 % at the kilo scale and close to 10 % at the tera scale.[10] A drive sold as 1 TB holds 101210^{12} bytes, which is about 931 GiB.

Percent gap between binary and decimal byte prefixesHow much larger the binary unit is than the decimal unit0 %2 %4 %6 %8 %10 %12 %14 %16 %Percent difference2.40 %4.86 %7.37 %9.95 %12.59 %15.29 %kilo / kibimega / mebigiga / gibitera / tebipeta / pebiexa / exbie.g. 1 KiB = 1024 B vs 1 kB = 1000 B
Each bar compares a binary prefix with the decimal prefix of the same rank kk, from kilo (10310^3) and kibi (2102^{10}) at k=1k = 1 to exa (101810^{18}) and exbi (2602^{60}) at k=6k = 6. The binary unit is larger by the fraction 1.024k−11.024^k - 1, from 2.40 % at k=1k = 1 to 15.29 % at k=6k = 6.

Bits per second and bytes per second

Data sizes are usually given in bytes, but transfer speeds over a network are usually given in bits per second.[10] The unit for byte rates is the byte per second (B/s).[9] Because a byte has eight bits, a link of 100 megabits per second (Mbit/s) moves at most 12.5 megabytes per second (MB/s).

History

Timeline of the byte, 1955 to 2010 195519601965197019751980198519901995200020052010 June 1956Earliest record of “byte”Buchholz, IBM Stretch, 1 to 6 bits 1959First published useBlaauw, Brooks, Buchholz Apr 7, 1964System/360 announcedFixed 8-bit byte 1980Cohen proposesnetwork byte order Dec 1998IEC binary prefixeskibi, mebi, ... 1962Planning a ComputerSystem defines byte Aug 19568-bit bytes consideredfor Stretch 2008IEC 80000-13: byte= octet = 8 bits
Key events in the history of the byte, from Werner Buchholz's first use of the word for the IBM Stretch in 1956 to the IEC 80000-13 definition of 2008, which treats a byte as an octet (a unit of exactly eight bits). The highlighted marker is the 1964 IBM System/360, which fixed the byte at 8 bits.

Creating the word

Werner Buchholz created the word byte in 1956 while working on the IBM Stretch computer.[11] He took it from "bite" and changed the spelling so it would not be accidentally turned into "bit".[12]

The early records of the word, as Buchholz described them, are these.[12]

  • June 1956. An internal Stretch memo, the earliest known record, describes a byte as one to six bits handled at the same time (in parallel). Input and output equipment of the time handled six bits at a time.
  • August 1956. The team considered 8-bit bytes and built them into the Stretch design shortly after.
    1. The word first appeared in print, in the paper "Processing Data in Bits and Pieces" by G. A. Blaauw, F. P. Brooks Jr., and W. Buchholz.
    1. The book Planning a Computer System, edited by Buchholz, defined a byte as "a group of bits used to encode a character, or the number of bits transmitted in parallel to and from input-output units".

The 8-bit standard

The IBM System/360, announced on April 7, 1964, made the 8-bit byte standard.[13] Stretch had given an address to each single bit and allowed bytes of different sizes. System/360 fixed the byte at eight bits to save cost and gave addresses to whole bytes instead. Since then the word byte has generally meant eight bits.[12]

Other byte sizes

Some older machines used byte for groups of 6, 7, or 9 bits. The PDP-10 supported bytes of any size from 1 to 36 bits.[11] These uses are no longer found.[11]

Byte versus octet

The word byte once had several sizes, so different groups settled the question in different ways.

The octet

Standards that need an exact size use the word octet, which always means eight bits. For example, the Internet Protocol specification describes an address as four octets (32 bits).[14]

IEC guidance

IEC 80000-13, first published in 2008, states that in English the name byte, symbol B, is another name for octet, symbol o, meaning an eight-bit byte.[15] It notes that byte has been used for other sizes and strongly recommends using byte and B only for eight-bit bytes. The 2025 edition keeps the same note.[9][15]

The C language

The C programming language keeps the older, general meaning. Its standard defines a byte as the smallest unit of storage that has its own address and can hold any character of the basic character set of the system running the program.[3] It leaves the number of bits in a byte to each Compiler (a program that turns source code into instructions a computer can run) and platform, as long as it is at least eight.[3][16]

Byte order

A value larger than one byte is stored as several bytes at consecutive addresses, and computers differ in the order they use. This order is called Endianness.[7]

  • Little-endian systems store the least significant byte at the lowest address. x86 processors work this way.[7]
  • Big-endian systems store the most significant byte at the lowest address.[7]

Byte order matters mainly when machines exchange data, since both sides must agree on it. In 1980 Danny Cohen urged the Internet community to adopt one standard order, and the Internet Engineering Task Force later chose big-endian as the "network byte order".[7]

Big-endian and little-endian byte order Value 0x0A0B0C0D 0A 0B 0C 0D Most significant byte Least significant byte Big-endian (network byte order) 0A 0B 0C 0D 100 101 102 103 Little-endian (e.g. x86) 0D 0C 0B 0A 100 101 102 103 Increasing address
The 4-byte value 0x0A0B0C0D\texttt{0x0A0B0C0D} stored at addresses 100 to 103. Big-endian order puts the most significant byte 0A\texttt{0A} at the lowest address, and little-endian order puts the least significant byte 0D\texttt{0D} there.

References

  1. Binary and Data Representation, Dive Into Systems (Matthews, Newhall, and Webb), 2022.
  2. Number Bases and Unsigned Integers, Dive Into Systems (Matthews, Newhall, and Webb), 2022.
  3. Programming languages: C, working draft N2310, ISO/IEC JTC 1/SC 22/WG 14, 2018.
  4. nybble, The Jargon File (Eric S. Raymond), 2003.
  5. RFC 20: ASCII format for Network Interchange, Vint Cerf, 1969.
  6. RFC 3629: UTF-8, a transformation format of ISO 10646, IETF, 2003.
  7. Integer Byte Order, Dive Into Systems (Matthews, Newhall, and Webb), 2022.
  8. Prefixes for binary multiples, NIST Reference on Constants, Units, and Uncertainty.
  9. IEC 80000-13:2025, Quantities and units, Part 13: Information science and technology (preview), IEC, 2025.
  10. About bits and bytes: prefixes for binary multiples, International Electrotechnical Commission.
  11. byte, The Jargon File (Eric S. Raymond), 2003.
  12. Origin of the word "byte" in computers (Buchholz, "The word 'byte' comes of age", BYTE, February 1977), Computer History Museum archive, 1977.
  13. The IBM System/360, IBM.
  14. RFC 791: Internet Protocol, Information Sciences Institute (for DARPA), 1981.
  15. IEC 80000-13:2008, Quantities and units, Part 13: Information science and technology (sample), IEC, 2008.
  16. 5.2.4.2.1 Sizes of integer types (text of WG14/N1124), The New C Standard (Derek M. Jones), 2005.

Figure