How to convert bits to bytes
- Take the value in bits.
- Use the formula bytes = bits ÷ 8.
- For example, 8 bit is 1 B.
About bits and bytes
A byte is 8 bits, so divide bits by 8 to get bytes. 64 bits is 8 bytes, 256 bits is 32 bytes and 2,048 bits is 256 bytes.
Key sizes, hash lengths, network packets and CPU registers are described in bits, while file sizes and memory are counted in bytes. A lowercase b means bits and an uppercase B means bytes, which is the source of most mix-ups.
Examples
- 8 bit (one byte) is 1 B
- 128 bit (an AES-128 key or an IPv6 address) is 16 B
- 256 bit (a SHA-256 hash or an AES-256 key) is 32 B
- 2,048 bit (an RSA-2048 key) is 256 B
Bits to bytes chart
| Bits | Bytes (B) |
|---|---|
| 1 | 0.125 |
| 4 | 0.5 |
| 8 | 1 |
| 16 | 2 |
| 24 | 3 |
| 32 | 4 |
| 48 | 6 |
| 64 | 8 |
| 96 | 12 |
| 128 | 16 |
| Bits | Bytes (B) |
|---|---|
| 160 | 20 |
| 192 | 24 |
| 256 | 32 |
| 384 | 48 |
| 512 | 64 |
| 1,024 | 128 |
| 2,048 | 256 |
| 4,096 | 512 |
| 8,192 | 1,024 |