Skip to content

Powers of two

Computers count in powers of two, people count in powers of ten, and estimates live in the gap between them. Knowing that 2¹⁰ is about a thousand and 2³² is about four billion lets you size key spaces, memory and storage in your head. It also helps you notice when a “1 TB” disk shows up as 931 “GB”.

The converter takes an amount in any unit and shows the exact number of bytes, plus the same quantity in decimal (SI) and binary (IEC) units. It accepts decimal commas, digit grouping and suffixes such as 2.5k or 3M. The table lists every power from 2⁷ to 2⁵⁰; bold rows are the ones to memorise, and the checkbox hides the rest.

Byte converter

Exact bytes
—
In decimal units (SI)
—
In binary units (IEC)
—

Powers of two from 2⁷ to 2⁵⁰. Bold rows are the ones worth memorising.

PowerExact valueApprox. decimalBinary (IEC)Decimal (SI) ≈
27128128128 B
28256256256 B
29512512512 B
2101,0241.02 thousand1 KiB1.02 KB
2112,0482.05 thousand2 KiB2.05 KB
2124,0964.1 thousand4 KiB4.1 KB
2138,1928.19 thousand8 KiB8.19 KB
21416,38416.4 thousand16 KiB16.4 KB
21532,76832.8 thousand32 KiB32.8 KB
21665,53665.5 thousand64 KiB65.5 KB
217131,072131 thousand128 KiB131 KB
218262,144262 thousand256 KiB262 KB
219524,288524 thousand512 KiB524 KB
2201,048,5761.05 million1 MiB1.05 MB
2212,097,1522.1 million2 MiB2.1 MB
2224,194,3044.19 million4 MiB4.19 MB
2238,388,6088.39 million8 MiB8.39 MB
22416,777,21616.8 million16 MiB16.8 MB
22533,554,43233.6 million32 MiB33.6 MB
22667,108,86467.1 million64 MiB67.1 MB
227134,217,728134 million128 MiB134 MB
228268,435,456268 million256 MiB268 MB
229536,870,912537 million512 MiB537 MB
2301,073,741,8241.07 billion1 GiB1.07 GB
2312,147,483,6482.15 billion2 GiB2.15 GB
2324,294,967,2964.29 billion4 GiB4.29 GB
2338,589,934,5928.59 billion8 GiB8.59 GB
23417,179,869,18417.2 billion16 GiB17.2 GB
23534,359,738,36834.4 billion32 GiB34.4 GB
23668,719,476,73668.7 billion64 GiB68.7 GB
237137,438,953,472137 billion128 GiB137 GB
238274,877,906,944275 billion256 GiB275 GB
239549,755,813,888550 billion512 GiB550 GB
2401,099,511,627,7761.1 trillion1 TiB1.1 TB
2412,199,023,255,5522.2 trillion2 TiB2.2 TB
2424,398,046,511,1044.4 trillion4 TiB4.4 TB
2438,796,093,022,2088.8 trillion8 TiB8.8 TB
24417,592,186,044,41617.6 trillion16 TiB17.6 TB
24535,184,372,088,83235.2 trillion32 TiB35.2 TB
24670,368,744,177,66470.4 trillion64 TiB70.4 TB
247140,737,488,355,328141 trillion128 TiB141 TB
248281,474,976,710,656281 trillion256 TiB281 TB
249562,949,953,421,312563 trillion512 TiB563 TB
2501,125,899,906,842,6241.13 quadrillion1 PiB1.13 PB

Two families of prefixes describe bytes, and they are often mixed up:

Decimal (SI)ValueBinary (IEC)ValueBinary is larger by
kilobyte, KB10³ = 1,000kibibyte, KiB2¹⁰ = 1,0242.4%
megabyte, MB10⁶mebibyte, MiB2²⁰ = 1,048,5764.9%
gigabyte, GB10⁹gibibyte, GiB2³⁰7.4%
terabyte, TB10¹²tebibyte, TiB2⁴⁰10%
petabyte, PB10¹⁵pebibyte, PiB2⁵⁰12.6%

The IEC introduced the binary names in 1999 to end the ambiguity, but both meanings of “GB” are still in use:

  • Drive makers, network speeds and most cloud storage prices use decimal units. A “1 TB” drive holds 10¹² bytes, and 1 Gbit/s is 10⁹ bits per second.
  • Memory is sized in binary units, even when the label says “GB”: a 16 GB DIMM holds 16 GiB.
  • Operating systems differ. Windows reports binary sizes with decimal labels, which is why a 1 TB disk appears as “931 GB”. macOS uses decimal units. Linux tools vary: ls -lh and df -h print powers of 1,024 with bare K, M, G suffixes, while df -H prints powers of 1,000.
  • Cloud services choose either. Some bill block storage per GiB-month, others per GB-month; check the docs when a 7% difference matters.
QuestionPowers of two at work
How many IDs fit in a 32-bit or 64-bit integer?2³² ≈ 4.3 × 10⁹ runs out at web scale; 2⁶⁴ ≈ 1.8 × 10¹⁹ does not.
How long must a short URL key be?Base62 with 7 characters gives 62⁷ ≈ 3.5 × 10¹² keys (about 2⁴²): plenty for billions of links issued by a counter; with random keys retries grow as the space fills, so the URL shortener moves to 8 characters at tens of billions.
Will random IDs collide?The birthday bound: collisions become likely after about 2^(n/2) random n-bit IDs, so about 4 billion for 64-bit IDs. A random UUID has 122 random bits.
How much memory does an index take?100 million entries × 64 bytes = 6.4 × 10⁹ bytes ≈ 6 GiB: one large server, not a cluster.
How many shards or partitions?Powers of two split evenly: going from 2ᵏ to 2ᵏ⁺¹ shards splits each shard in two and moves about half of its keys.
How big is a page or block?Memory pages are usually 4 KiB, database pages 8–16 KiB, SSD reads 4 KiB, object-storage multipart parts at least 5 MiB.

When you estimate, keep units visible all the way through: “10⁸ objects × 1 KB = 10¹¹ bytes = 100 GB”. Writing the exponent makes slips of a factor of 1,000 obvious.

  • Power of two — properties and a longer table.
  • Binary prefix — history of the KiB/MiB names and how operating systems display sizes.
  • Napkin Math — techniques for keeping units and orders of magnitude straight.

Based on The System Design Primer by Donne Martin (CC BY 4.0). Restructured, rewritten and updated; site content is licensed under CC BY 4.0.