Bit vs Byte

A bit is the smallest unit of data, holding a single 0 or 1. A byte is a group of 8 bits, enough to store one character or a number from 0 to 255.

General Programming

Bits measure raw data and network speeds (megabits per second), while bytes measure file and storage sizes (kilobytes, megabytes). Eight bits make one byte.

Examples

Python

byte_value = 0b11111111  # 8 bits all set
print(byte_value)

Output:

255

See also

Back to the Dictionary