Units
How many bits are in a byte?
8bits in a byte
Eight on/off bits, so one byte has 2⁸ = 256 possible values (0 to 255).
Eight. That has been universal for decades, which is why the standards call an 8-bit unit an 'octet' when they want to be completely unambiguous.
The arithmetic
- 1 byte = 8 bits; 4 bits (half a byte) is a 'nibble'
- Each bit doubles the possibilities: 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 256
- That is why one colour channel in an 8-bit image runs from 0 to 255
| Bits | Distinct values |
|---|---|
| 1 bit | 2 |
| 4 bits | 16 |
| 8 bits | 256 |
| 16 bits | 65,536 |
| 24 bits | 16,777,216 |
| 32 bits | 4,294,967,296 |