Computing

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.

Try itDrag to choose a bit width n. The range and binary pattern update from the same exact calculation.
28 =
256
In binary
100000000
Unsigned range of 8 bits
0 to 255
Signed (two’s complement) range
-128 to 127
As bytes
256 bytes

Powers of 2 chart

The chart lists 2⁰ through 2³² and the larger exponents you meet most often in programming and networking.

PowerValueWhere you see it
201
212
224
238
2416
2532
2664
27128
28256values in one byte
29512
2101,0241 KiB
2112,048
2124,096
2138,192
21416,384
21532,768
21665,536values in 16 bits; 65,535 is the max 16-bit unsigned
217131,072
218262,144
219524,288
2201,048,5761 MiB
2212,097,152
2224,194,304
2238,388,608
22416,777,216colours in 24-bit RGB
22533,554,432
22667,108,864
227134,217,728
228268,435,456
229536,870,912
2301,073,741,8241 GiB
2312,147,483,648max signed 32-bit int is 2³¹ − 1
2324,294,967,296IPv4 address space
2401,099,511,627,7761 TiB
248281,474,976,710,656MAC address space
2539,007,199,254,740,992JavaScript safe-integer limit is 2⁵³ − 1
2639,223,372,036,854,775,808max signed 64-bit int is 2⁶³ − 1
26418,446,744,073,709,551,616values 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:

BitsUnsigned rangeSigned range (two’s complement)
80 to 255−128 to 127
160 to 65,535−32,768 to 32,767
320 to 4,294,967,295−2,147,483,648 to 2,147,483,647
640 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

  1. Prefixes for binary multiples — NIST. Kibi, mebi, gibi as 2¹⁰, 2²⁰, 2³⁰
  2. RFC 791: Internet Protocol — IETF. 32-bit IPv4 addresses
  3. Number.MAX_SAFE_INTEGER — MDN
  4. 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.

Copied to clipboard!