Log Calculator (Logarithm)

Logarithm of any number in any base — log base 10, natural log (ln), log base 2 and more.

log₁₀(1000)
—
—
—
—

Calculate the logarithm of a number in any base, with log base 10, natural log (ln) and log base 2 shown together and the change-of-base steps written out.

What a logarithm means

A logarithm is the inverse of an exponent. logb(x) = y means exactly the same thing as by = x: the logarithm is the power you raise the base to in order to get the number.

  • log₁₀(1000) = 3, because 10³ = 1000
  • log₂(64) = 6, because 2⁶ = 64
  • log₅(125) = 3, because 5³ = 125
  • ln(20) ≈ 2.9957, because e2.9957 ≈ 20

The three most common bases

  • Base 10 (common log) — used for orders of magnitude, decibels, the pH scale and the Richter scale.
  • Base e (natural log, ln) — e ≈ 2.71828; appears in continuous growth and decay, compound interest and calculus.
  • Base 2 (binary log) — used in computer science: log₂ of a number tells you how many bits you need, or how many times you can halve something.

Change-of-base formula

To find a logarithm in any base using only ln or log₁₀:

logb(x) = ln(x) ÷ ln(b)

Example: log₃(50) = ln(50) ÷ ln(3) = 3.9120 ÷ 1.0986 ≈ 3.5609. Check: 33.5609 ≈ 50.

Useful logarithm rules

  • Product: log(a × c) = log(a) + log(c)
  • Quotient: log(a ÷ c) = log(a) − log(c)
  • Power: log(an) = n × log(a)
  • Special values: logb(1) = 0 and logb(b) = 1 for any valid base

Frequently asked questions

What is a logarithm?

A logarithm answers the question "what power do I raise the base to, to get this number?" Because 10³ = 1000, log base 10 of 1000 is 3. In general, log_b(x) = y means b^y = x.

What is the difference between log and ln?

"log" usually means log base 10 (the common logarithm), while "ln" is the natural logarithm, base e ≈ 2.71828. In some math and programming contexts "log" means the natural log, so check which one your textbook or language uses.

How do I calculate a log with a different base?

Use the change-of-base formula: log_b(x) = ln(x) ÷ ln(b), or equivalently log₁₀(x) ÷ log₁₀(b). That is how calculators that only have log and ln buttons handle any base.

Why can't I take the log of zero or a negative number?

No power of a positive base ever produces zero or a negative number, so the logarithm of those values is undefined in the real numbers. The base itself must also be positive and not equal to 1.