Powers of 2 table

2^0 to 2^64, exact values and hex.

Powers of 2

65 rows
n2ⁿHexNotes
0
1
2
3
4
5
6
7
8Values in 1 byte
9
101 KiB (kibibyte)
11
12
13
14
15
16Values in 16 bits
17
18
19
201 MiB (mebibyte)
21
22
23
24
25
26
27
28
29
301 GiB (gibibyte)
31
32Values in 32 bits (IPv4 addresses)
33
34
35
36
37
38
39
401 TiB (tebibyte)
41
42
43
44
45
46
47
48
49
501 PiB (pebibyte)
51
52
53
54
55
56
57
58
59
601 EiB (exbibyte)
61
62
63
64Values in 64 bits

Click a green value to copy it.

Type in the box to filter, or press / to jump to it.

Runs in your browser. Nothing uploaded.

How to use the powers of 2 table

  1. 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.
  2. Check the Notes column for the powers that matter in computing, such as 2^10 (1 KiB) and 2^32 (every IPv4 address).
  3. Click a value to copy it as plain digits, without the commas. A hex value copies with its 0x.

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 labeling 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 color 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.