What Is Log Base 2?
Log base 2 of a number $x$, written $\log_2 x$, is the exponent you put on 2 to get $x$. In symbols:
$$\log_2 x = y \quad\Longleftrightarrow\quad 2^y = x.$$
So $\log_2 8 = 3$ because $2^3 = 8$, and $\log_2 32 = 5$ because $2^5 = 32$. The logarithm and the exponent are the same fact looked at from opposite ends — one asks "what is $2^3$?", the other asks "2 to what gives 8?". That two-way relationship is the whole of log to exponential form conversion, and it is worth holding onto: every log base 2 statement is just an exponent statement in disguise.
Log base 2 is also called the binary logarithm, sometimes written $\operatorname{lb} x$ or $\lg x$. The "binary" name is a hint about where it earns its keep — anything built on two states, on/off, 0/1, splitting in half.
How Do You Calculate Log Base 2?
There are two cases, and which one you are in decides the method.
When $x$ is a power of 2, read the answer straight off. Ask how many times you multiply 2 to reach $x$:
$$\log_2 16 = 4 \quad\text{since}\quad 2^4 = 16.$$
No calculator needed. The powers of 2 — 1, 2, 4, 8, 16, 32, 64, 128, 256 — are worth knowing on sight, because the binary logarithm of each is just its position in that list.
When $x$ is not a power of 2, use the change-of-base formula. Calculators have $\ln$ (natural log) and $\log$ (base 10) but rarely a base-2 button, so convert:
$$\log_2 x = \frac{\ln x}{\ln 2} = \frac{\log x}{\log 2}.$$
For example, $\log_2 10 = \dfrac{\ln 10}{\ln 2} \approx \dfrac{2.3026}{0.6931} \approx 3.32$. That makes sense: 10 sits between $2^3 = 8$ and $2^4 = 16$, so its binary logarithm sits between 3 and 4. The full reasoning behind change of base lives in properties of logarithms — here we just use it.
Log Base 2 Value Table
For the exact powers of 2, the binary logarithm is a clean whole number. This table is the one to memorise.
$x$ | $\log_2 x$ | Because |
|---|---|---|
$1$ | $0$ | $2^0 = 1$ |
$2$ | $1$ | $2^1 = 2$ |
$4$ | $2$ | $2^2 = 4$ |
$8$ | $3$ | $2^3 = 8$ |
$16$ | $4$ | $2^4 = 16$ |
$32$ | $5$ | $2^5 = 32$ |
$64$ | $6$ | $2^6 = 64$ |
$128$ | $7$ | $2^7 = 128$ |
$256$ | $8$ | $2^8 = 256$ |
$1024$ | $10$ | $2^{10} = 1024$ |
Two boundary facts close the table: $\log_2 1 = 0$ (anything to the power 0 is 1), and $\log_2 0$ is undefined — no power of 2 ever reaches 0, it only gets smaller and smaller. Logarithms of zero and of negative numbers do not exist in the real numbers.
What Are the Properties of Log Base 2?
Log base 2 obeys the same laws as every logarithm — they just carry a subscript 2. These come straight from the logarithm rules, specialised to base 2.
Product rule: $\log_2(MN) = \log_2 M + \log_2 N$ — a product turns into a sum.
Quotient rule: $\log_2!\left(\dfrac{M}{N}\right) = \log_2 M - \log_2 N$ — a quotient turns into a difference.
Power rule: $\log_2(M^p) = p,\log_2 M$ — an exponent comes down front.
Base of itself: $\log_2 2 = 1$, and more generally $\log_2 2^k = k$.
Log of 1: $\log_2 1 = 0$ in every base.
The product rule is the one doing quiet work everywhere: because $\log_2(M N) = \log_2 M + \log_2 N$, multiplication in the world becomes addition on the log scale. That is the same trick that made logarithms revolutionary for hand-calculation in the 1600s — and it is why a doubling becomes a simple "+1" in base 2.
Examples of Log Base 2
The six examples climb from a direct read-off to an applied bit-counting problem — the kind of thing log base 2 is actually used for.
Example 1
Find $\log_2 64$.
Ask: 2 to what power gives 64? Since $2^6 = 64$,
$$\log_2 64 = 6.$$
Final answer: $6$.
Example 2
Find $\log_2 12$ — and watch the tempting wrong move first.
Wrong attempt. A student reasons "$12 = 4 \times 3$, and $\log_2 4 = 2$, so $\log_2 12 = 2 \times 3 = 6$." Check it: $2^6 = 64$, nowhere near 12. The answer cannot be 6, because 12 lies between $2^3 = 8$ and $2^4 = 16$, so the log must be between 3 and 4. The mistake was multiplying where the log laws say add.
Correct. The product rule turns the product into a sum, not a product of logs:
$$\log_2 12 = \log_2(4 \times 3) = \log_2 4 + \log_2 3 = 2 + \log_2 3.$$
Then $\log_2 3 = \dfrac{\ln 3}{\ln 2} \approx 1.585$, so $\log_2 12 \approx 3.585$ — comfortably between 3 and 4.
Final answer: $\log_2 12 \approx 3.585$.
Example 3
Find $\log_2 \dfrac{1}{8}$.
A reciprocal of a power of 2 has a negative logarithm. Since $\dfrac{1}{8} = 2^{-3}$,
$$\log_2 \frac{1}{8} = -3.$$
Final answer: $-3$.
Example 4
Use the change-of-base formula to find $\log_2 50$.
$$\log_2 50 = \frac{\ln 50}{\ln 2} \approx \frac{3.912}{0.693} \approx 5.64.$$
Sanity check: $2^5 = 32$ and $2^6 = 64$, and 50 is between them, so 5.64 fits.
Final answer: $\log_2 50 \approx 5.64$.
Example 5
Simplify $\log_2 8 + \log_2 4$ using the product rule.
$$\log_2 8 + \log_2 4 = \log_2(8 \times 4) = \log_2 32 = 5.$$
You can check the long way: $3 + 2 = 5$. Both routes agree.
Final answer: $5$.
Example 6
How many bits are needed to store a number from 0 to 999?
Storing $N$ distinct values needs $\lceil \log_2 N \rceil$ bits — the binary logarithm rounded up. With 1000 values:
$$\log_2 1000 = \frac{\ln 1000}{\ln 2} \approx 9.97, \qquad \lceil 9.97 \rceil = 10.$$
Check: $2^9 = 512$ (too few) and $2^{10} = 1024$ (enough).
Final answer: $10$ bits.
Why Log Base 2 Runs Through Computing
Base 10 is the language of everyday arithmetic and base $e$ is the language of calculus, but base 2 is the native tongue of computers — and the reason is that computers store everything in bits, each of which is one of two states. Counting those states is counting powers of 2, and the binary logarithm is what reverses that count.
Bits to represent a number. A value up to $N$ needs $\lceil \log_2 N \rceil$ bits. This is why a "32-bit" integer maxes out near $2^{32}$ — about 4.3 billion.
Algorithm speed. Binary search, balanced search trees, and merge sort all run in time proportional to $\log_2 n$, because each step halves the problem. Halving a billion takes about 30 steps — the search-bar fact from the top.
Information theory. Claude Shannon measured information in bits, and one bit is exactly $\log_2 2$ of choice. Entropy, compression, and coding all rest on the binary logarithm.
Digital signals and memory. Memory addresses, file sizes, and image bit-depth are all powers of 2, so log base 2 is the tool that converts a size back into a count of address lines or colour levels.
This is the exponent idea wearing its everyday clothes: doubling is the most common growth pattern in computing, and the binary logarithm is how you undo it.
Where Students Trip Up on Log Base 2
The errors here are rarely about arithmetic — they are about base and domain. Three catch people most often.
Mistake 1: Forgetting the base and using base 10 by reflex
Where it slips in: Reading $\log 8$ on a calculator and treating it as $\log_2 8$.
Don't do this: Assume a bare $\log$ means base 2. On most calculators a bare $\log$ is base 10, so $\log 8 \approx 0.903$, not 3.
The correct way: Either find $\log_2 8 = 3$ directly, or use change of base: $\dfrac{\log 8}{\log 2} = \dfrac{0.903}{0.301} = 3$. The base is part of the question, never optional.
Mistake 2: Taking the log of zero or a negative number
Where it slips in: Trying to evaluate $\log_2 0$ or $\log_2(-4)$.
Don't do this: Report a number. No power of 2 produces 0 or a negative result — $2^y$ is always positive — so these have no real value.
The correct way: State that $\log_2 0$ and $\log_2(-4)$ are undefined. The domain of any logarithm is the positive reals only.
Mistake 3: Multiplying logs instead of adding them
Where it slips in: Simplifying $\log_2 4 + \log_2 8$.
Don't do this: Multiply to get $\log_2 4 \times \log_2 8 = 2 \times 3 = 6$ and call it the answer to the sum.
The correct way: The product rule converts a product inside the log into a sum of logs, not the other way around: $\log_2 4 + \log_2 8 = \log_2(4 \times 8) = \log_2 32 = 5$. The memoriser archetype — fluent in the rule's words — still mixes up which side gets the product.
A real-world version of the mistake. Underestimating how many bits a number needs is the binary-logarithm version of these slips, and it has wrecked real systems. The widely reported Year 2038 problem comes from storing time in a signed 32-bit integer, which can only count up to about $2^{31}$ seconds past 1970 — running out in January 2038. Because the designers reasoned about a fixed power of 2 instead of the value's true range, the clock will overflow. The fix everywhere is the same one Example 6 teaches: ask $\lceil \log_2 N \rceil$ before choosing the storage size.
The Short Version
Log base 2 of $x$ is the power of 2 that gives $x$: $\log_2 x = y$ means $2^y = x$, so $\log_2 8 = 3$.
For powers of 2, read the answer off the value table; for other numbers, use change of base, $\log_2 x = \dfrac{\ln x}{\ln 2}$.
The product, quotient, and power rules apply with a subscript 2 — multiplication becomes addition on the log scale.
The most common mistake is forgetting the base and reading a calculator's base-10 $\log$ as if it were base 2.
Log base 2 measures information in bits and the step-count of halving algorithms, which is why it runs through computer science.
Practice These Before Moving On
Find $\log_2 128$.
Find $\log_2 \dfrac{1}{16}$.
Use change of base to estimate $\log_2 20$.
Simplify $\log_2 16 - \log_2 2$.
How many bits store a number from 0 to 500?
Answer to Question 1: $7$. Answer to Question 2: $-4$. Answer to Question 3: $\approx 4.32$. Answer to Question 4: $3$ (since $\log_2 8 = 3$). Answer to Question 5: $9$ bits (since $2^9 = 512 \geq 500$). If Question 4 caught you, revisit the quotient rule in the properties section.
Want a live Bhanzu trainer to walk through more log base 2 problems with your child? Book a free demo class — online globally.
Was this article helpful?
Your feedback helps us write better content
