Powers of 2: Chart, Binary Patterns and Bit Ranges
A powers of 2 chart from 2⁰ to 2⁶⁴, why each extra bit doubles the range, and how byte, IPv4 and integer limits fall out of the same table.
A power of 2 is 2 multiplied by itself a number of times: 2⁰ = 1, 2¹ = 2, 2² = 4, 2³ = 8, and so on. In computing, 2ⁿ is also the number of different values n bits can hold, so every extra bit doubles the range.
Eight bits give 2⁸ = 256 patterns. That is why a byte stores 0 to 255, why an IPv4 address octet stops at 255, and why the next power of two, 2⁹ = 512, needs a ninth bit.
- 28 =
- In binary
100000000- Unsigned range of 8 bits
- Signed (two’s complement) range
- As bytes
Powers of 2 chart
The chart lists 2⁰ through 2³² and the larger exponents you meet most often in programming and networking.
| Power | Value | Where you see it |
|---|---|---|
| 20 | 1 | |
| 21 | 2 | |
| 22 | 4 | |
| 23 | 8 | |
| 24 | 16 | |
| 25 | 32 | |
| 26 | 64 | |
| 27 | 128 | |
| 28 | 256 | values in one byte |
| 29 | 512 | |
| 210 | 1,024 | 1 KiB |
| 211 | 2,048 | |
| 212 | 4,096 | |
| 213 | 8,192 | |
| 214 | 16,384 | |
| 215 | 32,768 | |
| 216 | 65,536 | values in 16 bits; 65,535 is the max 16-bit unsigned |
| 217 | 131,072 | |
| 218 | 262,144 | |
| 219 | 524,288 | |
| 220 | 1,048,576 | 1 MiB |
| 221 | 2,097,152 | |
| 222 | 4,194,304 | |
| 223 | 8,388,608 | |
| 224 | 16,777,216 | colours in 24-bit RGB |
| 225 | 33,554,432 | |
| 226 | 67,108,864 | |
| 227 | 134,217,728 | |
| 228 | 268,435,456 | |
| 229 | 536,870,912 | |
| 230 | 1,073,741,824 | 1 GiB |
| 231 | 2,147,483,648 | max signed 32-bit int is 2³¹ − 1 |
| 232 | 4,294,967,296 | IPv4 address space |
| 240 | 1,099,511,627,776 | 1 TiB |
| 248 | 281,474,976,710,656 | MAC address space |
| 253 | 9,007,199,254,740,992 | JavaScript safe-integer limit is 2⁵³ − 1 |
| 263 | 9,223,372,036,854,775,808 | max signed 64-bit int is 2⁶³ − 1 |
| 264 | 18,446,744,073,709,551,616 | values in 64 bits |
Why the binary form is always 1 followed by zeros
In binary, each place is worth twice the place to its right, so 2ⁿ is written as a 1 with n zeros after it, exactly the way 10ⁿ is a 1 with n zeros in decimal:
- 2³ = 8 =
1000₂ - 2⁸ = 256 =
1 0000 0000₂ (nine bits) - 2⁸ − 1 = 255 =
1111 1111₂ (the largest 8-bit number is all ones)
That second pattern is the useful one: 2ⁿ − 1 is the largest value that fits in n bits. Subtracting one from 1000 0000₂ borrows all the way down and leaves seven ones. You can check any of these in the binary table generator.
Bit ranges at a glance
Programming languages and file formats pick integer sizes in powers of two because those sizes line up with bytes. The same table gives both unsigned and signed limits:
| Bits | Unsigned range | Signed range (two’s complement) |
|---|---|---|
| 8 | 0 to 255 | −128 to 127 |
| 16 | 0 to 65,535 | −32,768 to 32,767 |
| 32 | 0 to 4,294,967,295 | −2,147,483,648 to 2,147,483,647 |
| 64 | 0 to 18,446,744,073,709,551,615 | −9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
The signed range is lopsided by one because one bit pattern is spent on zero: half of the 2ⁿ patterns are negative (−2ⁿ⁻¹ … −1) and the other half cover 0 … 2ⁿ⁻¹ − 1. The signed binary converter shows how each pattern maps to a negative number.
Three places powers of 2 show up
Memory units. A kibibyte (KiB) is 2¹⁰ = 1,024 bytes, a mebibyte (MiB) is 2²⁰ bytes and a gibibyte (GiB) is 2³⁰ bytes. NIST and the IEC reserve kilo, mega and giga for powers of 10, which is why a drive sold as 1 TB (10¹² bytes) shows as about 931 GiB in some operating systems.
Address spaces. IPv4 addresses are 32 bits long, so there are 2³² = 4,294,967,296 of them. A /24 subnet leaves 8 host bits, which is 2⁸ = 256 addresses. Ethernet MAC addresses use 48 bits, giving 2⁴⁸ possible identifiers.
Floating-point limits. JavaScript numbers are 64-bit floats with a 53-bit significand, so every integer up to 2⁵³ − 1 = 9,007,199,254,740,991 is exact. Above that, consecutive integers can no longer all be represented. That limit is exposed as Number.MAX_SAFE_INTEGER.
Shortcuts for estimating
- 2¹⁰ ≈ 10³. 1,024 is close to 1,000, so 2²⁰ is about a million and 2³⁰ about a billion. The error grows by about 2.4% per step: 2³⁰ is 7.4% more than 10⁹.
- Add exponents to multiply. 2¹⁰ × 2⁶ = 2¹⁶ = 65,536.
- Each bit doubles, each nibble multiplies by 16. Four more bits is one more hexadecimal digit.
To see how individual bits add up to any number, not just powers of two, the step-by-step binary to decimal walkthrough multiplies each bit by its power of 2 and sums the results.
Sources
- Prefixes for binary multiples — NIST. Kibi, mebi, gibi as 2¹⁰, 2²⁰, 2³⁰
- RFC 791: Internet Protocol — IETF. 32-bit IPv4 addresses
- Number.MAX_SAFE_INTEGER — MDN
- IEEE Registration Authority — IEEE. 48-bit MAC address identifiers
How we made this
Computed and checked by tests. Every value in the chart was generated with exact integer arithmetic (Python int and JavaScript BigInt) and the widget's ranges are covered by the site's test suite (tests/calc.test.mjs).
Performed by Claude, an AI assistant working in the BinConvert repository (Python 3.14.3, Node.js 25), November 16, 2026.
This article was drafted with AI assistance. Every example, calculation and command output on this page was re-run or checked before release; the chart was regenerated from code and compared line by line. Review: automated test suite and source check, November 16, 2026.
Spotted an error? Tell us and we will correct it.