Log Base 2 — Binary Logarithm, Values & Examples

#Algebra
TL;DR
Log base 2 of a number is the power to which 2 must be raised to produce that number — so log⁡28=3\log_2 8 = 3 because 23=82^3 = 8. This article covers what log base 2 (the binary logarithm) means, how to compute it by hand and with the change-of-base formula, a value table, its properties, where it powers computer science, and the slips to avoid.
BT
Bhanzu TeamLast updated on June 10, 20269 min read

What Is Log Base 2?

Log base 2 of a number xx, written log⁡2x\log_2 x, is the exponent you put on 2 to get xx. In symbols:

log⁡2x=y⟺2y=x.\log_2 x = y \quad\Longleftrightarrow\quad 2^y = x.

So log⁡28=3\log_2 8 = 3 because 23=82^3 = 8, and log⁡232=5\log_2 32 = 5 because 25=322^5 = 32. The logarithm and the exponent are the same fact looked at from opposite ends — one asks "what is 232^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 lb⁡x\operatorname{lb} x or lg⁡x\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 xx is a power of 2, read the answer straight off. Ask how many times you multiply 2 to reach xx:

log⁡216=4since24=16.\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 xx is not a power of 2, use the change-of-base formula. Calculators have ln⁡\ln (natural log) and log⁡\log (base 10) but rarely a base-2 button, so convert:

log⁡2x=ln⁡xln⁡2=log⁡xlog⁡2.\log_2 x = \frac{\ln x}{\ln 2} = \frac{\log x}{\log 2}.

For example, log⁡210=ln⁡10ln⁡2≈2.30260.6931≈3.32\log_2 10 = \dfrac{\ln 10}{\ln 2} \approx \dfrac{2.3026}{0.6931} \approx 3.32. That makes sense: 10 sits between 23=82^3 = 8 and 24=162^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.

xx

log⁡2x\log_2 x

Because

11

00

20=12^0 = 1

22

11

21=22^1 = 2

44

22

22=42^2 = 4

88

33

23=82^3 = 8

1616

44

24=162^4 = 16

3232

55

25=322^5 = 32

6464

66

26=642^6 = 64

128128

77

27=1282^7 = 128

256256

88

28=2562^8 = 256

10241024

1010

210=10242^{10} = 1024

Two boundary facts close the table: log⁡21=0\log_2 1 = 0 (anything to the power 0 is 1), and log⁡20\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⁡2M+log⁡2N\log_2(MN) = \log_2 M + \log_2 N — a product turns into a sum.

  • Quotient rule: log⁡2!(MN)=log⁡2M−log⁡2N\log_2!\left(\dfrac{M}{N}\right) = \log_2 M - \log_2 N — a quotient turns into a difference.

  • Power rule: log⁡2(Mp)=p,log⁡2M\log_2(M^p) = p,\log_2 M — an exponent comes down front.

  • Base of itself: log⁡22=1\log_2 2 = 1, and more generally log⁡22k=k\log_2 2^k = k.

  • Log of 1: log⁡21=0\log_2 1 = 0 in every base.

The product rule is the one doing quiet work everywhere: because log⁡2(MN)=log⁡2M+log⁡2N\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⁡264\log_2 64.

Ask: 2 to what power gives 64? Since 26=642^6 = 64,

log⁡264=6.\log_2 64 = 6.

Final answer: 66.

Example 2

Find log⁡212\log_2 12 — and watch the tempting wrong move first.

Wrong attempt. A student reasons "12=4×312 = 4 \times 3, and log⁡24=2\log_2 4 = 2, so log⁡212=2×3=6\log_2 12 = 2 \times 3 = 6." Check it: 26=642^6 = 64, nowhere near 12. The answer cannot be 6, because 12 lies between 23=82^3 = 8 and 24=162^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⁡212=log⁡2(4×3)=log⁡24+log⁡23=2+log⁡23.\log_2 12 = \log_2(4 \times 3) = \log_2 4 + \log_2 3 = 2 + \log_2 3.

Then log⁡23=ln⁡3ln⁡2≈1.585\log_2 3 = \dfrac{\ln 3}{\ln 2} \approx 1.585, so log⁡212≈3.585\log_2 12 \approx 3.585 — comfortably between 3 and 4.

Final answer: log⁡212≈3.585\log_2 12 \approx 3.585.

Example 3

Find log⁡218\log_2 \dfrac{1}{8}.

A reciprocal of a power of 2 has a negative logarithm. Since 18=2−3\dfrac{1}{8} = 2^{-3},

log⁡218=−3.\log_2 \frac{1}{8} = -3.

Final answer: −3-3.

Example 4

Use the change-of-base formula to find log⁡250\log_2 50.

log⁡250=ln⁡50ln⁡2≈3.9120.693≈5.64.\log_2 50 = \frac{\ln 50}{\ln 2} \approx \frac{3.912}{0.693} \approx 5.64.

Sanity check: 25=322^5 = 32 and 26=642^6 = 64, and 50 is between them, so 5.64 fits.

Final answer: log⁡250≈5.64\log_2 50 \approx 5.64.

Example 5

Simplify log⁡28+log⁡24\log_2 8 + \log_2 4 using the product rule.

log⁡28+log⁡24=log⁡2(8×4)=log⁡232=5.\log_2 8 + \log_2 4 = \log_2(8 \times 4) = \log_2 32 = 5.

You can check the long way: 3+2=53 + 2 = 5. Both routes agree.

Final answer: 55.

Example 6

How many bits are needed to store a number from 0 to 999?

Storing NN distinct values needs ⌈log⁡2N⌉\lceil \log_2 N \rceil bits — the binary logarithm rounded up. With 1000 values:

log⁡21000=ln⁡1000ln⁡2≈9.97,⌈9.97⌉=10.\log_2 1000 = \frac{\ln 1000}{\ln 2} \approx 9.97, \qquad \lceil 9.97 \rceil = 10.

Check: 29=5122^9 = 512 (too few) and 210=10242^{10} = 1024 (enough).

Final answer: 1010 bits.

Why Log Base 2 Runs Through Computing

Base 10 is the language of everyday arithmetic and base ee 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 NN needs ⌈log⁡2N⌉\lceil \log_2 N \rceil bits. This is why a "32-bit" integer maxes out near 2322^{32} — about 4.3 billion.

  • Algorithm speed. Binary search, balanced search trees, and merge sort all run in time proportional to log⁡2n\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⁡22\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\log 8 on a calculator and treating it as log⁡28\log_2 8.

Don't do this: Assume a bare log⁡\log means base 2. On most calculators a bare log⁡\log is base 10, so log⁡8≈0.903\log 8 \approx 0.903, not 3.

The correct way: Either find log⁡28=3\log_2 8 = 3 directly, or use change of base: log⁡8log⁡2=0.9030.301=3\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⁡20\log_2 0 or log⁡2(−4)\log_2(-4).

Don't do this: Report a number. No power of 2 produces 0 or a negative result — 2y2^y is always positive — so these have no real value.

The correct way: State that log⁡20\log_2 0 and log⁡2(−4)\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⁡24+log⁡28\log_2 4 + \log_2 8.

Don't do this: Multiply to get log⁡24×log⁡28=2×3=6\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⁡24+log⁡28=log⁡2(4×8)=log⁡232=5\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 2312^{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 ⌈log⁡2N⌉\lceil \log_2 N \rceil before choosing the storage size.

The Short Version

  • Log base 2 of xx is the power of 2 that gives xx: log⁡2x=y\log_2 x = y means 2y=x2^y = x, so log⁡28=3\log_2 8 = 3.

  • For powers of 2, read the answer off the value table; for other numbers, use change of base, log⁡2x=ln⁡xln⁡2\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⁡\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

  1. Find log⁡2128\log_2 128.

  2. Find log⁡2116\log_2 \dfrac{1}{16}.

  3. Use change of base to estimate log⁡220\log_2 20.

  4. Simplify log⁡216−log⁡22\log_2 16 - \log_2 2.

  5. How many bits store a number from 0 to 500?

Answer to Question 1: 77. Answer to Question 2: −4-4. Answer to Question 3: ≈4.32\approx 4.32. Answer to Question 4: 33 (since log⁡28=3\log_2 8 = 3). Answer to Question 5: 99 bits (since 29=512≥5002^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

Frequently Asked Questions

What is log base 2 of 1?
Zero. log⁡21=0\log_2 1 = 0 because 20=12^0 = 1 — and the log of 1 is 0 in every base.
Why is log base 2 important in computer science?
Because computers store data in bits (two-state units), and counting bits means counting powers of 2. The binary logarithm reverses that count — it tells you how many bits a number needs and how many steps a halving algorithm takes.
How do you convert log base 10 to log base 2?
Use the change-of-base formula: log⁡2x=log⁡xlog⁡2\log_2 x = \dfrac{\log x}{\log 2}, where log⁡\log is base 10. Dividing any base-10 log by log⁡2≈0.301\log 2 \approx 0.301 rescales it to base 2.
What does lb⁡\operatorname{lb} or lg⁡\lg mean?
Both are shorthand for the binary logarithm, log⁡2\log_2. The ISO standard uses lb⁡\operatorname{lb}; some computer-science texts use lg⁡\lg. They all mean log base 2.
Is log base 2 the same as log base 10?
No. They differ by a constant factor — every log base 2 value is about 3.32 times the matching base-10 value, since 1log⁡2≈3.32\dfrac{1}{\log 2} \approx 3.32.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →