Powers of Two Reference Table

2 to the 0 through 2 to the 63 with decimal and hex values.

Reference table of powers of two from 2^0 up to 2^256, showing each value in decimal and hexadecimal with binary-prefix labels (KiB, MiB, GiB). Exact BigInt values you can copy for bit masks, buffer sizes, and limits.

Why do powers of two matter in computing?

Computers store data in bits, so capacities, address ranges, and limits cluster on powers of two. A byte holds 2^8 = 256 values and a 32-bit unsigned integer maxes out at 2^32 - 1, which is why these exact numbers come up constantly.

Powers of two are the backbone of how computers measure and address everything: memory sizes, integer limits, bit flags, and color depths all land on a power of two. This reference lists 2 raised to each exponent in decimal and hexadecimal, marks the binary-prefix boundaries, and lets you copy any exact value.

How it works

Each row is computed by repeated doubling, starting from 2 to the power 0:

2^0 = 1
2^(n+1) = 2 * (2^n)

The decimal column is the value itself; the hex column is the same number in base 16, where powers of two are especially tidy. Binary prefixes attach at the round exponents — 2^10 is one kibibyte (KiB), 2^20 is one mebibyte (MiB), 2^30 is one gibibyte (GiB), and so on up through PiB, EiB, ZiB, and YiB. Every value uses BigInt, so even 2^256 prints its full 78-digit integer exactly.

Tips and example

  • An unsigned 8-bit byte holds 2^8 = 256 distinct values (0–255); a 16-bit value holds 2^16 = 65536.
  • In hex, each factor of 16 shifts by four bits: 2^4 is 0x10, 2^8 is 0x100, 2^12 is 0x1000 — a quick way to sanity-check bit masks.
  • The gap between binary and decimal prefixes grows: a “1 TB” drive (10^12 bytes) is only about 0.909 TiB (2^40 bytes), which is why advertised and reported sizes differ.

Copy the exact value you need straight into a constant or a comment without retyping a long number.