Math & ScienceAny base

Logarithm Calculator

A logarithm answers one question: what power do I raise this base to in order to get that number? Everything else — decibels, pH, half-lives, algorithm complexity — is that question in costume.

Logarithm

The number must be positive. The base must be positive and not equal to 1.

10 = common log, 2.71828 = natural log
Gives bᵉ — the inverse operation
LOG BASE b OF x
Natural log (ln x)
Common log (log₁₀ x)
Binary log (log₂ x)
Antilog (bᵉ)
Exponential form
Check — b raised to the result

Change of base, step by step

log_b(x) = ln(x) ÷ ln(b)
ln(x)
ln(b)
Order of magnitude of x
Bits needed to store x
Is the result exact?

Three bases, three habitats

Base 10 (the common log) counts digits and powers of ten. It runs the decibel scale, pH, the Richter scale and every chart axis labelled 1, 10, 100, 1000.

Base e (the natural log, ln) is the one that appears whenever something grows or decays continuously — compound interest, radioactive decay, cooling, population models. It looks arbitrary until you meet calculus, where it is the only base whose rate of change equals itself.

Base 2 (the binary log) counts halvings and doublings. It is how many bits a number needs, how many times you can split a list in half, and why binary search on a million items takes twenty steps rather than a million.

Change of base: one formula covers everything

logb(x) = ln(x) / ln(b). Any base can be computed from any other, which is why calculators only ever ship with two log buttons. The division is shown above step by step so the result can be checked by hand.

The three rules that do the real work

log(ab) = log a + log b. log(a/b) = log a − log b. log(an) = n log a. Together they turn multiplication into addition and powers into multiplication, which is the entire reason logarithms were invented — and why slide rules worked. The third rule is the one that matters most today: it is how you solve for an unknown exponent, such as how many years an investment takes to double.

Why the number must be positive

No real power of a positive base ever produces a negative result or zero, so log of a negative number and log of zero simply do not exist in the reals. As x approaches zero the log falls without limit, which is why the calculator reports "tends to −∞" rather than an error — the behaviour is well defined even though the value is not.

Frequently Asked Questions

What is the difference between log and ln?
Unqualified "log" usually means base 10, while "ln" always means base e (about 2.71828). In some fields — pure maths, many programming languages — a bare log means the natural log, so it is worth checking which convention a source is using.
How do I calculate a log in a base my calculator does not have?
Divide two logs you do have: log_b(x) = ln(x) / ln(b), or equally log₁₀(x) / log₁₀(b). The change-of-base block above shows both halves of the division.
What is an antilog?
The inverse of a logarithm — raising the base back to that power. If log₁₀(1000) = 3, then the antilog of 3 in base 10 is 10³ = 1000. The antilog field above does this directly.
Why can I not take the log of zero or a negative number?
Because no real exponent applied to a positive base produces zero or a negative result. The function is only defined for positive inputs; approaching zero, it falls towards negative infinity without ever arriving.
Where these numbers come from

Sources

Official publications only. Links open the original document in a new tab.