How to use the powers of 2 table
- Scroll to the power you want, or type the exponent (16), the power (2^16), a value (65536) or a size (1 GB) into the filter box.
- Check the Notes column for the powers that matter in computing, such as 2^10 (1 KiB) and 2^32 (every IPv4 address).
- Click a value to copy it as plain digits, without the commas.
Why computers use powers of two
A bit has two states, so every extra bit doubles the number of values you can store: 8 bits give 256, 16 bits give 65,536. Memory is addressed in binary too, which is why RAM sizes, cache sizes and many file format limits land on a power of two. In hexadecimal every power of two looks round, a 1, 2, 4 or 8 followed by zeros, which is why programmers write sizes in hex. The number base converter shows any value in binary, hex and decimal side by side.
KiB vs kB
| Unit | Bytes | Unit | Bytes |
|---|---|---|---|
| kB (kilobyte) | 1,000 | KiB (kibibyte) | 1,024 |
| MB (megabyte) | 1,000,000 | MiB (mebibyte) | 1,048,576 |
| GB (gigabyte) | 1,000,000,000 | GiB (gibibyte) | 1,073,741,824 |
| TB (terabyte) | 1,000,000,000,000 | TiB (tebibyte) | 1,099,511,627,776 |
Drive makers use the decimal units, but Windows counts in the binary ones while still labelling them GB. That’s why a new 1 TB drive shows up as about 931 GB: nothing is missing, it’s the same number of bytes divided by 1,024 three times instead of 1,000.
Values worth knowing
- 256 (2^8): the values in one byte. Each RGB colour channel and each part of an IPv4 address runs from 0 to 255.
- 1,024 (2^10): one KiB, the step between each binary unit.
- 65,536 (2^16): the values in 16 bits. Network ports go from 0 to 65,535, and old versions of Excel stopped at 65,536 rows.
- 2,147,483,648 (2^31): a signed 32-bit integer holds up to one less than this. Unix time stored that way runs out in January 2038.
- 4,294,967,296 (2^32): every IPv4 address, and the 4 GiB of memory a 32-bit program can address.
- 2^64: the range of a 64-bit integer, large enough that counters and IDs of that size are very unlikely to ever run out.