Skip to content
ToolsLeb ToolsLeb

Logarithm Calculator

Calculate the logarithm of a number to any base.

Simple Math

Calculator Inputs

Your Result

Enter your details and press Calculate to see your result.

Formula

Logarithm = Logarithm(Number (x), Base (0 for natural log, e))
Number (x)
Base (0 for natural log, e)

How it works

  1. Enter a positive number.
  2. Enter the base (or leave as 0 for the natural logarithm).
  3. View the logarithm.

Share on Social Media:

A logarithm answers the question: what power do I raise the base to, to get this number? logb(x) = y means bʸ = x. For example, log₁₀(1000) = 3 because 10³ = 1000. Enter a positive number and a base to get the result to 6 decimal places. Enter 0 as the base for the natural logarithm, ln.

How it's calculated

Using the change-of-base formula: logb(x) = ln(x) ÷ ln(b).

Examples

InputResultBecause
log₁₀(1000)310³ = 1000
log₂(1024)102¹⁰ = 1024
ln(10)2.302585e^2.302585 ≈ 10
log₁₀(0.01)−210⁻² = 0.01

Common bases

  • Base 10 (common log): used for decibels, the pH scale and the Richter magnitude scale.
  • Base e ≈ 2.71828 (natural log, ln): used for growth and decay, compound interest and calculus.
  • Base 2 (binary log): used in computing. log₂(n) is roughly the number of bits needed, or the steps in a binary search.

Logarithm rules

  • Product: log(xy) = log(x) + log(y)
  • Quotient: log(x/y) = log(x) − log(y)
  • Power: log(xⁿ) = n × log(x)
  • logb(1) = 0 and logb(b) = 1

Valid inputs

The number must be greater than 0: there's no real power of a positive base that gives zero or a negative number. The base must be positive and not equal to 1 (1 raised to any power is still 1). Bases between 0 and 1 are allowed and give negative results for numbers above 1.

Related: Root Calculator, Scientific Notation Calculator.

Frequently Asked Questions

The logarithm of a number for a given base — the power you'd need to raise the base to in order to get that number.

Log base 10 uses 10 as its base, common in everyday math, while natural log uses the mathematical constant e (≈2.718) as its base, common in calculus and science.

Yes — enter your desired base along with the number to compute the logarithm for that specific base.

Logarithms are only defined for positive real numbers in standard real-number math, since no real power of a positive base produces zero or a negative result.

log_b(x) answers the question "b raised to what power equals x?" For example, log_2(8) = 3, because 2³ = 8.

"log" (without a specified base) usually means base 10 (common logarithm), while "ln" specifically means the natural logarithm, base e (approximately 2.71828).

Not in the real number system — logarithms are only defined for positive numbers, since no real power of a positive base can produce a negative result or exactly zero.