Algebra

Logarithm Calculator

The logarithm logₐ(x) answers the question: to what power must the base a be raised to get x? This calculator uses the change-of-base formula logₐ(x) = ln(x)/ln(a) and verifies the answer by raising the base back to that power.

Logarithm Calculator

Logarithm of a value in any base, via change of base.

Try:
Answerlog₂(32) = 5
  1. Expressionlog₂(32)
  2. Change of baselogₐ(x) = ln(x) / ln(a) = 3.46574 / 0.693147
  3. Result= 5
  4. Check2^5 ≈ 32

Formula and method

logₐ(x) = ln(x) / ln(a) [change of base] logₐ(x) = y ↔ aʸ = x Domain: a > 0, a ≠ 1, x > 0

Applies the change-of-base formula logₐ(x) = ln(x) / ln(a) using the natural logarithm available in every JS runtime. The result is verified by raising a to the computed power and confirming it equals x (within floating-point tolerance). Domain constraints are enforced before computation: a must be positive and not equal to 1; x must be strictly positive. Logarithms of zero or negative numbers have no real value and produce a clear error.

Worked examples

Key terms

Frequently asked questions

What is the change-of-base formula?

Any logarithm can be rewritten with natural logs: logₐ(x) = ln(x) / ln(a).

What bases are allowed?

Any positive base other than 1, and any positive value. Logarithms of zero or negative numbers are undefined for real results.

Can the result be negative?

Yes. When the value is between 0 and 1 the logarithm is negative.