# Log Calculator (Logarithm)

Whether you want to calculate **natural log**, **common log**, or logarithm to an **arbitrary base**, this log calculator is your one tool to calculate them all! Here, you can calculate the logarithm of a **positive real number** to any base. Join us below in a brief discussion about logarithm and how to calculate the logarithm of a number to an arbitrary base using the log formula.

## What is logarithm?

The logarithmic function (log for short) is the *inverse* function of the exponentiation operation. If `b`

to the power `a`

gives `x`

, then the log of `x`

to the base `b`

would give `a`

. Mathematically, we can write this as:

where:

- $\log$ - The
**logarithmic function**; - $b$ - The
**base**, any positive real number $(b \neq 1)$; - $x$ - Any positive real number; and
- $a$ - The
**exponent**, any real number.

In words, we express $\log_b (x)$ as the **logarithm of x** to the **base b**.

## Natural log and common log

Although we can choose an arbitrary base, the two most common choices for the base are **Euler's number** $e$ and the number **ten**. We term the logarithm of a number to the **base** * e* as the

**natural logarithm**. Mathematically, we distinguish it with a unique representation - $\ln (x)$.

Among other applications, the natural log is useful in counting prime numbers and approximating factorials.

The **common logarithm** is the logarithm of a number to the **base 10**. There is no particular mathematical representation in this case; we write it as $\log_{10} (x)$. However, if no base is explicitly present in any log, we assume it refers to base 10:

Logarithm is useful in decibel calculation and pH calculation

Calculating log relies on using power series, arithmetic-geometric mean, or looking up available log tables. The answer is straightforward in some cases, say log_{10}(100). But there is a powerful logarithmic identity or log formula for shifting base, which we can use to calculate log to any base.

## Calculating logarithm to any base

The log formula for the change of base is:

Where

- $b$ is an arbitrary base; and
- $k$ is a base to which the log value is known or easy to compute. A popular choice is Euler's number
**e**, so the formula becomes:

Say you want to calculate log to the base 2 (which is common in computer science), then you need to evaluate:

Since $\ln (2)$ is a known value, calculating log base 2 becomes more accessible, because you only need to calculate natural log.

## How to use this log calculator

This log calculator is versatile to use. You can use it to find the logarithm value, the base, or the number you're taking the log of:

- Enter any two known values in any order, and watch our log calculator determine the unknown automatically.
- Make sure that the values in the logarithm calculator follow these rules:
`Base`

must be a positive real number that is not equal to 1.`Logarithm of`

value must be a positive real number.