Logarithm Calculator
logb(x), ln(x), log₂(x), and log₁₀(x) — live as you type.
Show the math
What Your Result Means
- logb(x): The power you raise your chosen base to in order to get x. For example, log₂(8) = 3 because 2³ = 8.
- ln(x): The natural logarithm — the power you raise Euler's number e (≈ 2.71828) to in order to get x. Widely used in calculus, physics, and compound-growth models.
- log₂(x): The binary logarithm — especially useful in computer science for measuring bits, binary tree depth, and algorithm complexity.
- log₁₀(x): The common logarithm — used in decibel scales, pH measurement, Richter magnitude, and scientific notation.
How This Calculator Works
You enter a positive number x and a base b (greater than 0 and not equal to 1). The tool computes the custom-base logarithm using the change-of-base identity: log_b(x) = ln(x) / ln(b). It also displays ln(x), log₂(x), and log₁₀(x) side by side. All calculations use the browser's built-in Math.log and Math.log10 functions.
Quick Questions
Why can't I use a base of 1 or a negative base?
A base of 1 would make the logarithm undefined because 1 raised to any power is always 1 — it can never reach any other number. Negative and zero bases are excluded because real-valued logarithms are only defined for positive bases other than 1.
Why can't I take the log of zero or a negative number?
In the real number system, no power of a positive base can produce zero or a negative result. Logarithms of non-positive numbers require complex numbers, which this calculator does not handle.
What is the change-of-base formula?
It states that log_b(x) = ln(x) / ln(b), or equivalently log_b(x) = log_c(x) / log_c(b) for any valid base c. This lets you compute any logarithm using just one built-in log function.
When would I use a custom base other than e, 2, or 10?
Custom bases appear in specific domains — for example, base-12 in some number systems, base-60 in time calculations, or arbitrary bases in certain information-theory and signal-processing formulas.
Sources
- Wikipedia — Logarithm (definition, properties, and change-of-base formula)
- Wikipedia — Natural Logarithm (properties of ln and Euler's number e)
- Wikipedia — Common Logarithm (base-10 logarithm applications)
Method & review
Estimate only. Results reflect your inputs and standard formulas. Double-check important decisions independently.