Logarithm Calculator

log_b(x) for any base b > 0, b ≠ 1, x > 0. Common bases shown side-by-side.

Inputs

Result

Loading calculator…

General calculation reads

Amazon affiliate

As an Amazon Associate we may earn from qualifying purchases. This does not add cost for you.

How to use this calculator

  • Enter x and the base.
  • Read the log; the breakdown shows base-10, natural, and base-2 logs for reference.

About this calculator

A logarithm answers: "to what power must I raise the base to get x?" log₁₀(100) = 2 because 10² = 100. Common bases: base 10 (log), base e ≈ 2.718 (ln, natural log), base 2 (used in computer science). Change-of-base formula lets you compute log in any base from natural log: log_b(x) = ln(x) / ln(b).

How it works — the formula

logₐ(x) = y ⟺ aʸ = x (general) log(x) := log₁₀(x) (common log) ln(x) := logₑ(x), e ≈ 2.71828 (natural log) Change of base: logₐ(x) = ln(x) / ln(a)

The logarithm logₐ(x) is the exponent y to which the base a must be raised to produce x. The base must be positive and not 1; the argument must be strictly positive. The common log uses base 10 (standard for orders of magnitude — pH, decibels, Richter scale), and the natural log uses base e (standard for continuous-rate models — radioactive decay, compound interest, population growth). The change-of-base identity lets any calculator with one log function compute any other.

Worked examples

Example 1
Common log
Inputs:
log₁₀(1000)
Output:
3 (because 10³ = 1000)
Example 2
Natural log
Inputs:
ln(e²)
Output:
2 (because eˣ and ln are inverses)
Example 3
Change of base
Inputs:
log₂(10) via natural log
Output:
log₂(10) = ln(10) / ln(2) ≈ 3.3219

Limitations

  • log of zero is −∞ as a limit; log of a negative number is complex (not real).
  • Floating-point representation has ~15–16 significant digits; logarithms of very large or very small numbers may lose precision in the trailing digits.
  • Different mathematical communities use "log" to mean either log₁₀ (most science/engineering) or logₑ (most pure math) — clarify the base when ambiguous.
  • The series ln(1 + x) = x − x²/2 + x³/3 − … converges only for −1 < x ≤ 1; for larger arguments, use the change-of-base identity or built-in implementations.

Computed with the platform's IEEE 754 Math.log family; agreement with NIST tabulated values exceeds 12 significant digits across the typical input range.

Frequently asked

What is the natural log?+
log base e ≈ 2.71828, written ln(x). Appears throughout calculus and physics because the derivative of ln(x) is 1/x.
Can log of a negative number be computed?+
Not over the real numbers. Complex logs exist but are multi-valued; this calculator returns "—" for non-positive x.
Why are logs useful?+
They turn multiplication into addition: log(ab) = log(a) + log(b). This is why slide rules worked, and why log scales (decibels, pH, Richter) compress huge ranges into readable numbers.
What is log(1)?+
0 in any base — because b⁰ = 1 for any positive base b.
What is log(0)?+
Undefined — approaches negative infinity as x → 0⁺. The calculator rejects x ≤ 0.

Related calculators

More tools you might like

Hand-picked tools that pair well with this one — same audience, same intent.