Home › Math & Science › Logarithm Calculator

Logarithm Calculator

Logarithms turn up in pH, decibels, earthquake scales and computer science — usually right where a formula stops making intuitive sense. This free logarithm calculator finds the log of any positive number in base 10, base 2, base e, or any custom base you need, and runs backwards too: give it a finished logarithm and the antilog mode returns the original number.

—

How it works

A logarithm is an exponent in disguise. log_b(x) asks: to what power must I raise b to get x? Every logarithm is computed the same way under the hood — divide the natural log of the number by the natural log of the base — which is exactly what this tool's code does, so any base works, not just the famous three.

log_b(x) = ln(x) ÷ ln(b)  ·  Antilog: x = b^(result)  ·  log(1) = 0 in every base, log_b(b) = 1

The number x must be greater than 0, because no power of a positive base can reach 0 or a negative value. The base must be greater than 0 and not equal to 1 — base 1 is meaningless, since 1 raised to anything is still 1. Pick a custom base and a box appears for it; that box is read by the same calculation, so nothing on this page is decorative. In antilog mode the spec table hides, because the three-log comparison only makes sense in log mode.

Worked example

A student needs log base 10 of 1,000 for a chemistry problem. Step 1: ask the defining question — 10 to what power equals 1,000? Step 2: count the zeros — 10¹ = 10, 10² = 100, 10³ = 1,000. Step 3: read the answer — the power is 3, so log₁₀(1,000) = 3. The same machine in base 2: log₂(32) = 5, because 2⁵ = 32. Enter 1000 with base 10 above and the calculator shows 3, with ln(1000) = 6.907755 and log₂(1000) = 9.965784 in the table underneath.

Common mistakes

The biggest one is assuming your calculator's log button means the base you need: on most calculators log is base 10 and ln is base e, but in computer science texts log usually means base 2, and in advanced math it often means base e. Always check which base a formula assumes before trusting the number. The second trap is treating logs like ordinary numbers when combining them — log(a × b) is log(a) + log(b), not log(a) × log(b), and log(a + b) simplifies to nothing at all. And remember log(1) is 0 in every base, a fact that quietly anchors decibel and pH scales.

FAQ

What is a logarithm, in plain English?

A logarithm answers one question: what power do I raise this base to, to get that number? Log base 10 of 1,000 is 3 because 10³ = 1,000. Log base 2 of 32 is 5 because 2⁵ = 32. That is all a logarithm is — an exponent, seen from the other side.

What is the difference between log and ln?

They are the same operation with different bases. Log almost always means base 10 on calculators and in engineering; ln is the natural logarithm, base e (about 2.71828), used throughout calculus and science. This calculator offers both, plus base 2 for computing, plus any custom base you type in.

Why can't you take the logarithm of 0 or a negative number?

Because no power of a positive base can produce 0 or a negative result. Ten to any power is positive, two to any power is positive, and as the power drops toward negative infinity the result approaches 0 but never reaches it. So log(0) and log of a negative number have no real answer, and this calculator says so instead of showing an error code.

What is the antilog of a number?

The antilog undoes a logarithm: it raises the base to the power you give it. The antilog (base 10) of 3 is 10³ = 1,000. Use the antilog mode in this calculator when a formula hands you a finished logarithm — from pH, decibels or the Richter scale — and you need the original quantity back.

What does log base 2 mean and where is it used?

Log base 2 counts doublings: how many times you multiply 2 by itself to reach a number. It runs computer science — memory sizes, binary search steps, image color depth — because computers are built on doubling. Log₂(1,024) = 10 because 2¹⁰ = 1,024, which is why 10 bits hold 1,024 values.

Disclaimer: Results are for study and planning. For graded coursework, your instructor may require the working to be shown by hand — use this tool to check answers, not to replace understanding.