Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Logarithm Result
3
log base a of b
ln(b) 2.079442
ln(a) 0.693147

What This Calculator Does

This tool evaluates the logarithm of any positive value b in any valid base a. Standard calculators usually only offer base 10 (log) and base e (ln). With the change-of-base formula, you can compute a logarithm in any base — base 2 for computer science, base 16, or any custom base you need.

How to Use It

Enter the base a (any positive number other than 1) and the value b (any positive number). The calculator returns \(\log_a(b)\), along with the intermediate natural logarithms \(\ln(b)\) and \(\ln(a)\) so you can verify the work. The result answers the question: "To what power must I raise a to get b?"

The Formula Explained

The change-of-base formula states that $$\log_a(b) = \frac{\ln(b)}{\ln(a)}$$ Because natural logarithms (or any fixed-base logs) are available on every scientific calculator, dividing \(\ln(b)\) by \(\ln(a)\) converts the result into base a. The same result is obtained using log base 10: $$\log_a(b) = \frac{\log(b)}{\log(a)}$$ The ratio is identical regardless of the intermediate base used.

Diagram of the change-of-base formula as a fraction of natural logarithms
The change-of-base formula rewrites \(\log_a(b)\) as \(\ln(b)\) divided by \(\ln(a)\).

Worked Example

Suppose you want \(\log_2(8)\). Using the formula: \(\ln(8) \approx 2.0794415\) and \(\ln(2) \approx 0.6931472\). Dividing gives $$\frac{2.0794415}{0.6931472} = 3$$ This makes sense because \(2^3 = 8\). Another example: $$\log_5(125) = \frac{\ln(125)}{\ln(5)} = \frac{4.8283137}{1.6094379} = 3$$ since \(5^3 = 125\).

Two logarithmic curves of different bases plotted on shared axes
Logarithms of different bases are scaled versions of the same curve, all passing through (1, 0).

FAQ

Why must the base be positive and not equal to 1? Logarithms are only defined for positive bases other than 1. A base of 1 would make \(\ln(a) = 0\), causing division by zero.

Can b be negative or zero? No. The logarithm of a non-positive number is undefined in the real numbers, so b must be greater than 0.

Is the answer the same whether I divide by ln or log? Yes. \(\log_a(b)\) is the same whether you use natural logs or base-10 logs in the ratio — the choice of intermediate base cancels out.

Last updated: