StatGardenREF. DESK
Calculators/Maths/Logarithm
Maths

Logarithm calculator

Log in any base, plus the natural and common logs.

What this calculator does

A logarithm answers the question: to what power must this base be raised to get that number? It is the inverse of exponentiation, and it turns multiplication into addition: the property that made logarithm tables and slide rules indispensable for three centuries before electronic calculators.

Three bases dominate. Base 10 suits anything measured on decimal scales, base 2 counts doublings and appears throughout computing, and base e, the natural logarithm, arises wherever continuous growth or decay occurs, which is most of physics and much of finance.

The formula

Formulalog_b(x) = ln x / ln b; the inverse is b^y = x

The change of base formula lets any logarithm be computed from any other: log_b(x) equals ln x divided by ln b. That is why a calculator only needs one logarithm built in to produce all of them.

TermMeaning
log_b(x)The power to which b must be raised to give x.
lnNatural logarithm, base e ≈ 2.71828.
log₁₀Common logarithm, base 10.
log₂Binary logarithm, base 2.
AntilogThe inverse: bˣ.

The inputs explained

FieldWhat to enter
Value xThe value whose logarithm you want. It must be positive: logarithms of zero and negative numbers are undefined in real arithmetic.
Base bThe base. Common choices are 10, e (about 2.71828) and 2.

When to use it

Working with decibels, pH or magnitude

These scales are all logarithmic, which is why a small numeric step represents a large physical change. An earthquake one point higher on a magnitude scale releases roughly 32 times more energy.

Solving for time in growth problems

When an exponential equation has the unknown in the exponent, taking logarithms brings it down where it can be solved. This is how doubling time is derived.

Measuring algorithmic complexity

Binary logarithms count how many times a set can be halved, which is why binary search runs in log₂(n) steps.

Compressing a wide range of values

Plotting on a logarithmic axis makes data spanning several orders of magnitude readable, and turns exponential growth into a straight line.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

Logarithms of powers of ten

The common logarithm counts the zeros: its defining convenience.

Base 10
Valuelog_b(x)Natural log ln(x)Binary log log₂(x)
0.01-2.000-4.605-6.644
1000
101.0002.3033.322
1002.0004.6056.644
10003.0006.9089.966
10000006.00013.81619.932
The base-10 column returns exact integers for powers of ten. Values below one give negative logarithms, and the logarithm of one is zero in every base.

The same value in different bases

One thousand, expressed as a logarithm in a range of bases.

x = 1000
Baselog_b(x)Antilog b^x
29.9661.0715e+301
e (2.71828)6.908
44.983
83.322
103.000
1001.500
Larger bases give smaller logarithms, since fewer multiplications of a bigger number are needed to reach the same total. All of them are related by simple constant factors.

Questions

What is the difference between log and ln?

By common convention log means base 10 and ln means base e, the natural logarithm. In pure mathematics and some programming languages, log alone often means the natural logarithm, so it is worth checking which is meant.

Why is e the natural base?

Because the exponential function with base e is its own derivative, which makes it the natural choice wherever continuous change is described. It appears unavoidably in growth, decay, compounding and probability.

Can I take the log of a negative number?

Not within real numbers. No real power of a positive base produces a negative result. Complex logarithms exist but behave quite differently, having infinitely many values.

What is the change of base formula?

log_b(x) = ln x ÷ ln b, or equivalently log₁₀x ÷ log₁₀b. It converts between any two bases and is how calculators produce arbitrary-base logarithms from a single built-in function.

Why do logarithms turn multiplication into addition?

Because log(ab) = log a + log b. Multiplying numbers means adding their exponents, and a logarithm is an exponent. That identity is precisely what slide rules exploited.

For the inverse operation, see the exponent calculator. For doubling times, try the rule of 72.