CalcPro

Logarithm Calculator

Log of a number in any base, plus natural log and log base 10.

Understanding logarithms

A logarithm answers the question: "What power do I raise the base to in order to get this number?" For example, log₂(8) = 3 because 2³ = 8. Logarithms are the inverse of exponents and appear everywhere—from measuring sound intensity (decibels) and earthquake strength (Richter scale) to calculating compound interest and algorithm complexity in computer science.

This calculator finds the logarithm of any positive number in any base you choose, and also computes the two most common forms: natural logarithm (base e) and common logarithm (base 10).

The formula

logₑ(x) = ln(x) or log₁₀(x) or logᵦ(x) = ln(x) / ln(b)

The most practical form uses the change-of-base rule: to find the logarithm in any base, divide the natural logarithm of your number by the natural logarithm of your base. Most calculators only have buttons for ln and log₁₀, so this rule lets you compute any base.

Worked example

Find log₅(125):

  1. Identify your inputs: x = 125, base b = 5
  2. Calculate ln(125) = 4.8283 (natural log of 125)
  3. Calculate ln(5) = 1.6094 (natural log of 5)
  4. Divide: 4.8283 ÷ 1.6094 = 3
  5. Result: log₅(125) = 3

Verify: 5³ = 125 ✓

Find ln(20):

  1. Enter x = 20, base = e (or select "natural log")
  2. Calculate: ln(20) = 2.9957
  3. Result: ln(20) ≈ 2.996

Verify: e^2.996 ≈ 20 ✓

Find log₁₀(1000):

  1. Enter x = 1000, base = 10 (or select "common log")
  2. Calculate: log₁₀(1000) = 3
  3. Result: log₁₀(1000) = 3

Verify: 10³ = 1000 ✓

Common mistakes to watch

Negative or zero inputs: Logarithms of zero and negative numbers are undefined in real mathematics. Always enter a positive number.

Base of 1: log₁(x) is undefined because 1 raised to any power always equals 1—there's no unique answer. Bases must be positive and not equal to 1.

Confusing ln and log: In pure mathematics and science, "log" often means natural log (ln). In engineering and many calculators, "log" means base 10. This calculator lets you choose, so be intentional about which you need.

Forgetting the change-of-base rule: If your calculator only has ln and log₁₀ buttons but you need log₃(81), use logₓ(81) = ln(81) / ln(3) = 4.3944 / 1.0986 = 4. (Verify: 3⁴ = 81 ✓)

Mixing up the order: In logᵦ(x), the base b goes in the denominator of the change-of-base formula: ln(x) / ln(b), not the other way around. Reversing it gives you 1 / your answer.

Rounding too early: If you're chaining calculations, keep full precision in intermediate steps and round only at the end. Rounding ln(125) to 4.83 and ln(5) to 1.61 gives 4.83 / 1.61 ≈ 3.00, but starting with more decimals ensures accuracy.

Tips for real-world use

Logarithms compress large ranges into manageable numbers. The pH scale (measuring acidity) uses log₁₀; the decibel scale (sound) uses log₁₀; and half-lives in radioactive decay use natural log. If you're working with exponential growth (population, bacteria, investments) or decay (radioactive material, cooling), logarithms help you solve for time or rate. For instance, if you know an investment doubles every 7 years, natural log helps you find the annual growth rate. Always verify your result by raising the base to your answer—you should recover the original number (within rounding error).

Frequently asked questions

What's the difference between ln, log, and log₁₀?

ln (natural logarithm) uses base e ≈ 2.718 and appears in calculus, physics, and continuous growth. log₁₀ (common logarithm) uses base 10 and is standard in engineering and pH/decibel scales. "log" alone is ambiguous—it means ln in pure math but log₁₀ in many calculators and engineering contexts. This calculator lets you specify exactly which you need.

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

In real numbers, there is no power you can raise a positive base to that produces a negative result. Logarithms of negative numbers exist only in complex mathematics. For practical calculations, always use positive inputs.

Can the base be any number?

The base must be positive and cannot equal 1. Common bases are 2 (computer science), e (natural processes), and 10 (engineering). Base 2 is especially useful in binary and information theory.

How do I verify my logarithm answer?

Raise the base to the power of your result. If logᵦ(x) = y, then b^y should equal x. For example, if log₅(125) = 3, then 5³ = 125. Any mismatch suggests a calculation error.

What if I only have ln and log₁₀ buttons on my calculator?

Use the change-of-base formula: logᵦ(x) = ln(x) / ln(b) or log₁₀(x) / log₁₀(b). Divide the log of your number by the log of your base, both using the same log function.

When would I use logarithms in real life?

Logarithms solve exponential equations (how long until bacteria reach a limit?), measure intensity on compressed scales (earthquakes, sound, acidity), and simplify very large or very small numbers. They're essential in finance (compound interest), biology (population growth), and physics (radioactive decay).