Skip to content
BetterDL

Byte

Also called: octet, 8 bits

A group of 8 bits, the standard unit of memory and file size. A byte holds 256 patterns: 0 to 255 unsigned, or −128 to 127 in two's complement.

A byte is 8 bits. It's the unit computers use to measure memory, files and data, and each memory address usually holds one byte (see byte addressing).

What fits in a byte:

That last point is why bytes are almost always written in hex. A web color like #1E90FF is three bytes (red, green, blue), and a debugger shows memory as pairs of hex digits.

One character of plain English text is traditionally stored in one byte. In the ASCII code, the letter A is 65 = 01000001.

On units: in memory sizes, a kilobyte is commonly 2¹⁰ = 1024 bytes. Network speeds count bits, not bytes, so watch the lowercase b in "Mb/s".

0
128
1
64
0
32
0
16
0
8
0
4
0
2
1
1

Worked example

Example

One byte read three ways: 11001000

The same 8 bits, under three different readings.

  1. 1.

    Unsigned: 128 + 64 + 8 = 200.

  2. 2.

    Hex: split into nibbles, 1100 | 1000, giving C8₁₆.

  3. 3.

    Two's complement: the MSB is 1, so the value is 200 − 256 = −56.

  4. 4.

    The bits don't change. The format you choose decides the value.

Common mistakes

  • Saying a byte holds values up to 256. The largest unsigned byte is 255.

  • Mixing up bits and bytes: 8 megabits is 1 megabyte.

  • Writing a byte as a single hex digit. A byte always needs two, one per nibble.

Practice Byte

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Byte is taught in Number Systems and Memory.