Logarithm Calculator
Pick a base (10, e, 2, or any positive number ≠ 1) and enter a positive argument x. The calculator returns log_b(x) plus the three standard logs alongside.
log base 10 (common log) of x
3
- log₁₀(x)
- 3
- ln(x) = logₑ(x)
- 6.91
- log₂(x)
- 9.97
log_b(x) is the exponent y such that b^y = x. The calculator uses the change-of-base identity log_b(x) = ln(x) / ln(b), so any positive base works. Domain: x > 0; base must be > 0 and ≠ 1.
How to use this calculator
Enter the positive number you want to take the log of, choose a base — 10 (common log), e (natural log, ln), 2 (binary log), or a custom base of your own — then read off the result. log₁₀, ln and log₂ are always shown in the breakdown for reference.
How the calculation works
A logarithm log_b(x) answers "to what power must I raise b to get x?" — that is, if b^y = x, then y = log_b(x). Most computers only implement ln and log₁₀ natively, so any other base is computed via the change-of-base identity log_b(x) = ln(x) / ln(b). The domain is x > 0; the base must be positive and not equal to 1, otherwise the function is undefined.
Worked example
log₁₀(1000) — the calculator default. 10^3 = 1000, so log₁₀(1000) = 3. Switch the base to 2 and the same x = 1000 gives log₂(1000) = ln(1000) / ln(2) ≈ 6.907 / 0.693 ≈ 9.966. Switch to a custom base of 5 with x = 125 and you get log₅(125) = 3, because 5³ = 125.
Frequently asked questions
What's the difference between log, ln and log₁₀?
In maths and science, "ln" always means the natural logarithm (base e ≈ 2.71828). "log" with no subscript is ambiguous — calculators and engineers usually mean log₁₀, mathematicians often mean ln, and computer scientists often mean log₂. To avoid confusion, this calculator labels every output explicitly.
Why does x have to be positive?
There is no real number y such that b^y = 0 or b^y is negative for any positive base b — exponentials of real bases are always strictly positive. So log_b(0) and log_b(negative) are undefined over the reals. Complex logarithms exist, but they're multi-valued and outside the scope of this calculator.
Why can't the base be 1?
1 raised to any power is 1, so the equation 1^y = x has no solution unless x = 1 (in which case it has infinitely many). Bases of 0 or negative numbers are excluded for the same reason — they don't produce a well-defined, monotonic logarithm over the positive reals.
What is the change-of-base formula?
log_b(x) = log_c(x) / log_c(b) for any valid base c. In practice you pick c = e (so log_b(x) = ln(x)/ln(b)) or c = 10 (log_b(x) = log₁₀(x)/log₁₀(b)) because those are the bases most calculators support natively. This calculator uses the ln version internally.
When do I use log₁₀ vs ln vs log₂ in real life?
log₁₀ for orders of magnitude — decibels, pH, the Richter scale, anything counted by "how many zeroes". ln (natural log) for continuous growth and decay — compound interest in the limit, radioactive decay, calculus identities (the derivative of ln x is 1/x). log₂ for binary problems — bits of information, halving algorithms, doubling times.
How accurate are the results?
The calculator uses double-precision floating-point (≈15–16 significant decimal digits). For most schoolwork, engineering and finance use cases that's effectively exact. Extreme cases — very small x like 1e-300, or bases that round-trip badly — may show tiny last-digit artefacts, but the formula itself is exact.