Math
Logarithm calculator
A logarithm answers one question: what power do I raise this base to, to get that number?
What a logarithm is
logb(x) is the exponent you need to put on b to produce x. Since 10³ = 1000, log10(1000) = 3. That is the entire definition — everything else follows from it.
Because it inverts exponentiation, a logarithm turns multiplication into addition. That property is why logarithms existed for three centuries before electronic calculators: multiplying two large numbers became adding two table lookups, which is the principle a slide rule runs on.
The three bases you will meet
- Base 10 — the common log, written log. Used wherever numbers span orders of magnitude: pH, decibels, the Richter scale.
- Base e — the natural log, written ln, where e ≈ 2.71828. It appears wherever something grows or decays at a rate proportional to its current size, which covers compound interest, radioactive decay and population growth.
- Base 2 — the binary log. Counts halvings and doublings, so it shows up throughout computer science: the depth of a binary search over n items is log₂(n).
Note that "log" without a base is ambiguous. Mathematicians and many programming languages mean base e; engineers and calculators usually mean base 10. In this calculator the base is always explicit.
Change of base
Most calculators only have log and ln buttons, but you can get any base from either:
logb(x) = ln(x) / ln(b) = log10(x) / log10(b)
So log5(300) = ln(300) / ln(5) = 5.7038 / 1.6094 = 3.544. This calculator uses exactly that, which is why it can accept any base you type.
The rules worth memorising
- log(ab) = log a + log b
- log(a/b) = log a − log b
- log(an) = n log a
- logb(b) = 1, and logb(1) = 0 for any valid base
The third is the one that does the most work in practice, because it pulls an exponent down into a coefficient — which is how you solve for a variable stuck in an exponent. To find t in 2t = 50: take logs of both sides to get t log 2 = log 50, so t = log 50 / log 2 = 5.64.
Why zero and negatives fail
There is no power of 10 that gives 0 or a negative number. As x approaches 0 the logarithm falls without limit towards −∞, and it never arrives. Base 1 fails for a related reason: 1 raised to anything is 1, so log1(x) has no answer unless x is 1, and then it has infinitely many.
Common questions
What is the difference between log and ln?
log usually means base 10 and ln always means base e, approximately 2.71828. Confusingly, in pure mathematics and many programming languages, a bare log means the natural log — so check the context.
How do I calculate a log in a base my calculator does not have?
Use change of base: log base b of x equals ln(x) divided by ln(b). Any two logs of the same number differ only by a constant factor, so any base can produce any other.
Why can I not take the log of a negative number?
Because no real power of a positive base produces a negative result. As the input approaches zero the log heads towards negative infinity, and below zero it has no real value at all.
What is an antilog?
The inverse operation — raising the base to the power of the logarithm, which recovers the original number. If log base 10 of x is 3, the antilog is 10 cubed, which is 1000.