Free online calculators & unit converters — no sign-up needed.
Free calculators & converters, with plain-English explanations.
Home › Math Calculators › Logarithm Calculator - Log Any Base

Logarithm Calculator - Log Any Base

Quick answer: A logarithm answers the question: to what power must the base be raised to get this number, so log base 10 of 1000 is 3. The natural log uses base e, about 2.718. Key rules: log of a product is the sum of logs, log of a power brings the exponent down, and change of base divides natural logs.

Last reviewed: September 2026

Key facts

  • log2(32) = 5 because 25 = 32 — a logarithm asks “to what power?”.
  • log10(1000) = 3; ln(20) ≈ 2.996.
  • Change of base: logb(x) = ln(x) ÷ ln(b).
  • Logs compress huge ranges: pH, decibels and the Richter scale are all logarithmic.

A logarithm is the inverse of an exponent: logb(x) asks “to what power must I raise b to get x?” This free logarithm calculator finds the log of any number in any base — including the natural log (ln, base e) and common log (base 10).

Enter the number and the base. Below you will find the change-of-base formula and where logarithms secretly run the modern world, from pH to earthquakes.

How to use

  1. Enter the number x (must be positive).
  2. Enter the base b (positive, not 1).
  3. The logarithm appears instantly.
  4. Try base 10, base e (ln) and base 2 to feel the difference.

Logarithm definition and change of base

logb(x) = y  ⇔  by = x   ·   logb(x) = ln(x) ÷ ln(b)
TermMeaning
xThe number you take the log of (x > 0).
bThe base (b > 0, b ≠ 1).
yThe answer: the exponent that makes by = x.

Logs turn multiplication into addition: log(a×b) = log(a) + log(b) — the trick behind slide rules.

Worked examples

Base 2 and base 10

log2(32): 25 = 32, so the answer is 5 — “32 needs five doublings from 1”.

log10(1000) = 3 because 103 = 1000. Base-10 logs count digits: log10 of a million is 6.

Natural log via change of base

log3(20): ln(20) ÷ ln(3) ≈ 2.9957 ÷ 1.0986 ≈ 2.7268.

Check: 32.7268 ≈ 20. The calculator applies this formula for every base.

Where logarithms hide in real life

ScaleFormulaMeaning
pH−log10[H+]Each pH unit is 10× acidity
Decibels10 × log10(power ratio)+10 dB = 10× the power
Richterlog10(amplitude)+1 = ~32× the energy
Bitslog2(possibilities)n bits store 2n values
Compound growthln-basedContinuous growth uses e

Frequently asked questions

What is the difference between ln and log10?

ln is base e (≈ 2.71828), the natural choice for growth and calculus. log10 is base 10, the natural choice for orders of magnitude, pH and decibels.

Why is log of 0 or a negative number undefined?

No power of a positive base gives zero or a negative — by is always positive. The calculator flags these inputs.

What is the change-of-base formula?

logb(x) = ln(x) ÷ ln(b). It lets any calculator that knows ln compute any base — which is exactly what this tool does.

Why do scientists love logarithms?

They compress enormous ranges into readable numbers: pH 1–14 covers a 10-trillion-fold range of acidity.

What is log base 2 used for?

Computing: log2 counts doublings — bits needed, algorithm steps, and “how many times must this double” questions.

Sources

Key takeaways

  • logb(x) asks: “b to what power gives x?”
  • Any base via change of base: logb(x) = ln(x) ÷ ln(b).
  • pH, decibels, Richter and bits are all logarithms in disguise.

Explore more tools

All calculators  |  Unit converters  |  Scientific tools

Related tools

Comments

Leave a comment