Try it

log₂(x)10
Exact power of two2^10 = 1,024

Understand the result

What's going on

Log base 2 answers one question: how many times do you have to double 1 to reach this number? It shows up constantly in computing because doubling is exactly what an extra bit does - one more bit doubles how many values you can represent.

The formula

log₂(x) = y, where 2^y = x

Show the derivation, mnemonic, and worked example

Build it up

1 doubled once is 2. Doubled again is 4. Again is 8. Three doublings got you from 1 to 8, so log₂(8) = 3. That’s also exactly how many bits it takes to count from 0 up to 7 - eight distinct values, three bits. Log base 2 and bit counts are the same question asked two different ways.

Worked example

Worked example

x = 1024

1 → 2 → 4 → 8 → … → 1024 (10 doublings)

log₂(1024) = 10