Log Calculator

Calculate the logarithm of a number for any base.

How this calculator works

The logarithm answers the question: to what power must the base be raised to produce this value?

logₐ(x) = ln(x) / ln(a)
a = base · x = value · ln = natural logarithm

Common logarithm bases and their uses

Base 10 (common log) is widely used in engineering and science for scales like decibels and pH. Base e (natural log, ≈2.71828) shows up frequently in calculus, finance (continuous compounding), and natural growth/decay models. Base 2 is common in computer science for things like measuring algorithmic complexity.

Regardless of base, logarithms answer the same type of question: what exponent do you need to raise the base to, to get this value — which is why they're the inverse operation of exponentiation.

A worked example

Log base 2 of 32: since 2 to the 5th power equals 32, log base 2 of 32 equals 5 — this calculator confirms it via the natural log of 32 divided by the natural log of 2, roughly 3.466 divided by 0.693, approximately 5.

Log base 10 of 1,000 equals 3 (since 10 cubed equals 1,000), while the natural log of 1,000 is approximately 6.908 — both describing the same value 1,000, just relative to different bases.

Common logarithm bases

Base 10 (common log) and base e ≈ 2.71828 (natural log, written ln) are the two most frequently used logarithm bases. Common log appears often in engineering and scientific notation contexts, while natural log appears throughout calculus, finance (continuous compounding), and natural growth/decay models.

Base 2 logarithms are common in computer science, since they relate directly to binary representations and are used to calculate things like how many bits are needed to represent a given number of values.

Frequently asked questions

Why must the value be positive?

Logarithms are only defined for positive real numbers — the logarithm of zero or a negative number is undefined in real numbers.

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

Logarithms are only defined for positive real numbers in standard real-number math, since no real exponent applied to a positive base can produce a negative result.

What's the relationship between log and exponents?

They're inverse operations — if bˣ = y, then logᵦ(y) = x. Logarithms essentially 'undo' exponentiation, which is why they're useful for solving equations where the unknown is in an exponent.

What's the difference between log and ln?

'log' conventionally refers to base-10 logarithm, while 'ln' specifically refers to natural logarithm (base e). This calculator lets you specify any base directly.

Related calculators