# Log Base 2 Calculator

By Maciej Kowalski, PhD candidate
Last updated: Dec 04, 2020

Welcome to Omni's log base 2 calculator. Your favorite tool to calculate the value of `log₂(x)` for arbitrary (positive) `x`. The operation is a special case of the logarithm, i.e. when the log's base is equal to `2`. As such, we sometimes called it the binary logarithm.

So what is, e.g., the log with base `2` of `8`? Or `log₂ 16`? Or `log₂ 32`? Well, let's jump straight into the article and find out!

## What is a logarithm?

As soon as humanity learned to add numbers, it found a way to simplify the notation for adding the same number several times: multiplication.

`5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 = 8 * 5`

Then, an obvious question appeared: how could we write multiplying the same number several times? And again, there came some smart mathematician who introduced exponents.

`5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 = 5⁸`

However, there is always that one curious person who asks the wildest questions. In this case, they wondered if there was a way to invert all these operations. Lucky for us, mathematics, and the whole world of science, other curious people found the answer.

For addition, it was easy: the inverse operation is subtraction. For multiplication, it's still pretty simple: it's division. For exponents, however, the story gets more complicated. After all, we know that `5 + 8 = 8 + 5` and `5 * 8 = 8 * 5`, but `5⁸` is very different from `8⁵`. So what should the inverse operation give? If we have `5⁸`, should it return `5` or `8`?

The logarithm (of base `5`) would be the operation if we chose option `8`. In other words, it is a function that tells you the exponent needed to obtain the value. Symbolically, we can write the definition like so:

 💡 `logₐ(b)` gives you the power to which you'd need to raise `a` in order to obtain `b`. Note, however, that in general, this can be a fractional exponent.

For comparison, the inverse operation that would return the `5` from `5⁸` would be simply the (`8`-th) root. If we wanted to get a bit more technical, then we could say that, in general, if we had an expression `xʸ`, then the root is the inverse operation for `x`, while the logarithm is that for `y`. And if we wanted to get even more technical, we'd say that the first inverts a polynomial function, while the latter inverts an exponential one.

Before we move further, let us have a pretty bullet list with a few vital points of information about our new friend, the logarithm function.

• There are two very special cases of the logarithm which have unique notation: the natural logarithm and the logarithm with base `10`. We denote them `ln(x)` and `log(x)` (the second one simply without the small `10`), and their bases are, respectively, the Euler number `e` and (surprise, surprise!) the number `10`.
• The logarithm function is defined only for positive numbers. In other words, whenever we write `logₐ(b)`, we require `b` to be positive.
• Whatever the base, the logarithm of `1` is equal to `0`. After all, whatever we raise to power `0`, we get `1`.
• Logarithms are extremely important. And we mean EXTREMELY important. Outside of mathematics, they're used in statistics (e.g., the lognormal distribution), economy (e.g., the GDP index), medicine (e.g., the QUICKI index), and chemistry (e.g., the half-life decay). Also, quite a few physical units are based on logarithms, for instance, the Richter scale, the pH scale, and the dB scale.

Today, we'll focus on a very special case of the logarithm, i.e., base `2`, which we sometimes call the binary logarithm. In essence, we'll focus on taking the powers of `2` and... Well, on second thought, why don't we dedicate a whole section to this one?

## Binary logarithm

As mentioned at the end of the above section, the binary logarithm is a special case of the logarithmic function with base `2`. That means that we'll have expressions of the form `log₂(x)`, and we'll ask ourselves to what power we should raise `2` in order to obtain `x`. For instance, we can easily observe that `log₂ 4 = 2`.

Seemingly, `2` is a number like any other. However, it has some interesting properties. E.g., it is the smallest prime number and the only even one. Moreover, it's the base for any computer-related operations via the binary representation.

Since it's so important, let's recall a few basic powers of `2`. Remember that the exponent can also be `0` or even negative.

 x -3 -2 -1 0 1 2 3 4 5 6 7 8 2x ⅛ ¼ ½ 1 2 4 8 16 32 64 128 256

Now we can see some more examples than just the `log₂ 4 = 2` from above. For instance, we can say that the log with base `2` of `8` is `3`. Similarly, `log₂ 16 = 3` or `log₂ 32 = 5`.

But what is, say, `log₂ 5`? Surely, `5` is not a power of `2`.

To be precise, it's not an integer power of `2`. We have to remember that there are also fractional exponents, and indeed, here, we need one of those. Unfortunately, they're not so simple to guess. In some cases, we can try to use tricks like the change of base formula, but, in general, it's best to use an external tool - something like our log base 2 calculator.

In it, you can see two variable windows: `x` and `log₂(x)`. Hopefully, the notation is self-explanatory. For example, if you'd like to find `log₂ 16`, you need to input `16` under `x`, and the calculator will give you the answer in the other window. If you require `log₂ 32`, you enter `32`. Also, note how Omni's log base 2 calculator works both ways: you can either input the value of `x` and obtain `log₂(x)` or the other way round.

That'll be enough for today's lesson. Go, my young padawan, and make sure to play around with the calculator or any other algebra-related tool that we have on offer.

Maciej Kowalski, PhD candidate
People also viewed…

### Body fat

Use the body fat calculator to estimate what percentage of your body weight comprises of body fat.

### Lost socks

Socks Loss Index estimates the chance of losing a sock in the laundry.

### Modulo

The modulo calculator finds the solution of an expression x mod y = r.

### Square calc: find A, P, d

This square calc finds a (area), p (perimeter) and d (diagonal) of a square.