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.
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\).
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.