How to Use the Calculator?
To use the calculator, enter a value in either the “Number (x)” field or the “Log Base 2” field, and the calculator will instantly fill in the other one for you.
What Is a Logarithm?
Imagine you had to multiply very large numbers before calculators existed. Suppose you wanted to find $1000 \times 1000$, or even harder, $3200 \times 75$. Today this is easy with a calculator, but for hundreds of years people had to do such work by hand. Astronomers, sailors, engineers, and merchants often worked with large numbers, and calculations could take a long time. A single mistake could ruin the whole result.
It was this very thing that led to the invention of logarithms. Logarithms turned difficult multiplication and division problems into easier addition and subtraction problems. That was a huge advantage. Before modern technology, saving time on calculations was extremely important. If a method could turn “multiply these big numbers” into “just add two smaller numbers,” people were very interested.
To understand why logarithms are so useful, think about powers first. You already know that repeated multiplication can be written using exponents. For example, $2^3$ means $2 \times 2 \times 2$, and $10^4$ means $10 \times 10 \times 10 \times 10$. Logarithms ask the reverse question. Instead of asking, “What is $2^3$?” they ask, “To what power must I raise 2 to get 8?” That reverse idea is the heart of logarithms.
A logarithm tells us the exponent. That is the simplest and most important sentence to remember.
When we write “the logarithm of a number,” we are really asking a question like this: “What power should the base be raised to in order to make this number?” For example, since $2^3 = 8$, the logarithm base 2 of 8 is 3.
$$\log_2 8 = 3$$
This means exactly the same thing as:
$$2^3 = 8$$
These two statements are just different ways of saying the same fact. One is written in exponential form, and the other is written in logarithmic form.
Here is the general relationship:
$$\log_b a = c \iff b^c = a$$
This should be read like this: “The logarithm of $a$ with base $b$ is $c$ if and only if $b$ to the power $c$ equals $a$.” In other words, a logarithm answers the question: “What exponent gives me this number?”
For example, consider this equation:
$$10^2 = 100$$
In logarithmic form, this becomes:
$$\log_{10} 100 = 2$$
Why? Because 10 must be raised to the power 2 to make 100.
Let us look at another example:
$$3^4 = 81$$
So the logarithmic form is:
$$\log_3 81 = 4$$
Again, the logarithm is telling us the exponent.
Binary Logarithm
Now let us focus on one special kind of logarithm: the binary logarithm. “Binary” means “based on 2.” So a binary logarithm is a logarithm with base 2.
It is written as:
$$\log_2 x$$
This means: “To what power must 2 be raised to get $x$?”
For example:
$$\log_2 8 = 3$$
because:
$$2^3 = 8$$
Binary logarithms are especially important in computer science because computers work with bits, and bits are based on 2. In binary systems, many important numbers are powers of 2, such as 2, 4, 8, 16, 32, 64, 128, and so on. Because of this, $\log_2$ appears naturally when studying computers, memory, data, and algorithms.
Here is a very friendly way to think about $\log_2 x$: it tells you how many times you multiply 2 by itself to reach $x$. If the answer is a whole number, then $x$ is an exact power of 2. If the answer is not a whole number, then $x$ lies between two powers of 2.
For instance, since $2^4 = 16$ and $2^5 = 32$, the number 20 lies between 16 and 32, so $\log_2 20$ must lie between 4 and 5. Even if you do not know its exact decimal value yet, this is already useful information.
Powers of 2 and Their Binary Logarithms
It is a very good idea to memorize a few powers of 2, because they make binary logarithms much easier.
| $2^0 = 1$ |
| $2^1 = 2$ |
| $2^2 = 4$ |
| $2^3 = 8$ |
| $2^4 = 16$ |
| $2^5 = 32$ |
| $2^6 = 64$ |
| $2^7 = 128$ |
| $2^8 = 256$ |
| $2^9 = 512$ |
| $2^{10} = 1024$ |
From these, we immediately get the logarithms:
| $\log_2 1 = 0$ |
| $\log_2 2 = 1$ |
| $\log_2 4 = 2$ |
| $\log_2 8 = 3$ |
| $\log_2 16 = 4$ |
| $\log_2 32 = 5$ |
| $\log_2 64 = 6$ |
| $\log_2 128 = 7$ |
| $\log_2 256 = 8$ |
| $\log_2 512 = 9$ |
| $\log_2 1024 = 10$ |
Notice something beautiful here. The logarithm is simply the exponent. That is all it is doing.
Examples
Let us work through examples carefully, because this is the best way to make the idea feel natural.
Consider:
$$\log_2 4$$
This asks, “2 raised to what power gives 4?” Since $2^2 = 4$, we have:
$$\log_2 4 = 2$$
Now try:
$$\log_2 32$$
We ask, “2 raised to what power gives 32?” Since $2^5 = 32$, the answer is:
$$\log_2 32 = 5$$
Now look at:
$$\log_2 1$$
This one surprises many people. But remember that any nonzero number raised to the power 0 equals 1.
$$2^0 = 1$$
So:
$$\log_2 1 = 0$$
That makes sense, because the logarithm is the exponent.
Next, let us try:
$$\log_2 64$$
Since $2^6 = 64$, we get:
$$\log_2 64 = 6$$
Now let us think about a number that is not an exact power of 2, such as 12. We know:
$$2^3 = 8$$
and
$$2^4 = 16$$
Since 12 lies between 8 and 16, we know:
$$3 < \log_2 12 < 4$$
This tells us the binary logarithm of 12 is between 3 and 4. Its exact decimal value is about $3.58$, but even without a calculator, knowing it lies between 3 and 4 is a strong start.
Understanding Binary Logarithms with Doubling
A very helpful picture is to think in terms of doubling. Every time you multiply by 2, you move up one step in the binary logarithm.
Start with 1. Double it once and you get 2. Double again and you get 4. Then 8, 16, 32, and so on. The number of doublings needed is the binary logarithm.
For example, how many doublings from 1 are needed to reach 32?
From 1 to 2 is one doubling. From 2 to 4 is two doublings. From 4 to 8 is three doublings. From 8 to 16 is four doublings. From 16 to 32 is five doublings. So:
$$\log_2 32 = 5$$
This “count the doublings” idea is one of the nicest ways to understand binary logarithms.
