Skip to content
Math & Stats

Logarithm Calculator

Compute the logarithm of any value in any base with this free Logarithm Calculator. Quick buttons for base 10, base e, and base 2 included.

Logarithm Calculator

Method

How this calculator works

log_b(x) = ln(x) / ln(b) = Math.log(x) / Math.log(b). This change-of-base formula lets you compute a logarithm in any base b from the natural logarithm. The value x must be positive, and the base b must be positive and not equal to 1.

  1. Enter the value (x) you want the logarithm of; it must be greater than 0.
  2. Enter the base (b), or tap a quick button for base 10, e, or 2.
  3. Click Calculate or edit a field to recompute automatically.
  4. The tool applies the change-of-base formula log_b(x) = ln(x) / ln(b).
  5. Read the result and the full expression such as log₁₀(1000) = 3.

Examples

Worked examples

Real numbers, end-to-end results.

log₁₀(1000)

log₁₀(1000) = 3

10 raised to the power 3 equals 1000.

log₂(8)

log₂(8) = 3

2 raised to the power 3 equals 8.

ln(e) with base e

logₑ(2.71828) = 1

The natural log of e is exactly 1.

Use cases

When to use it

  • Working with pH, decibels, and the Richter scale in science.
  • Solving exponential growth and decay equations in algebra.
  • Analyzing algorithm complexity such as log-base-2 running times.
  • Converting between logarithmic scales in engineering and finance.

FAQ

Frequently asked questions

What is a logarithm?
A logarithm answers the question: to what power must the base be raised to produce a given value? For example, log₁₀(1000) = 3 because 10³ = 1000.
What is the difference between log and ln?
log usually means the common logarithm with base 10, while ln is the natural logarithm with base e ≈ 2.71828. Both are just logarithms with different bases.
Why must the value be positive?
Logarithms are only defined for positive real numbers. There is no real power of a positive base that produces zero or a negative number, so the input must be greater than 0.
Why can't the base be 1?
A base of 1 raised to any power is always 1, so it can never equal any other value. Bases must be positive and different from 1 for the logarithm to be defined.
How does the change-of-base formula work?
Any logarithm can be computed as log_b(x) = ln(x) / ln(b), or equivalently log(x) / log(b). This calculator uses that formula to support any valid base.