How a logarithm is calculated
log_b(x) answers: what power must b be raised to, to get x? Since most calculators only have a natural log (ln) built in, any base can be computed with the change-of-base formula — dividing the natural log of x by the natural log of b.
- b — the base — must be positive and ≠ 1
- x — the number — must be positive
- ln — natural logarithm (base e)
More detail
Why the base can't be 1 or negative
1 raised to any power is always 1, so log base 1 can never reach any x other than 1 — the equation has no unique solution, so it's undefined. A negative base is excluded too: with fractional exponents, raising a negative number to a power produces a result outside the real numbers, so real-valued logarithms require b > 0. The same logic keeps x > 0 — no real power of a positive base ever produces zero or a negative number.
Natural and common logs. Set base = 10 for the common logarithm (log₁₀), or base = e ≈ 2.71828 for the natural logarithm (ln). Base 2 is the one used for measuring information in bits.
Frequently asked questions
What is log base 10 of 100?
log₁₀(100) = 2, because 10² = 100. Enter base 10 and x = 100 above to confirm.
What is log base 2 of 8?
log₂(8) = 3, because 2³ = 8. Enter base 2 and x = 8 above to see it computed.
What's the difference between log and ln?
"log" (without a subscript) usually means log base 10, while "ln" always means the natural logarithm — log base e (e ≈ 2.71828). Set base = e above to get ln(x).
Why can't the base be 1?
1 raised to any power is always 1, so log base 1 could never produce any x other than 1 — there's no unique answer, so it's undefined. This calculator shows "—" if you enter base = 1.
Why does the calculator show "—" sometimes?
A logarithm is only defined for a positive base not equal to 1, and a positive x. If base ≤ 0, base = 1, or x ≤ 0, there's no real result, so the calculator shows "—" instead of a number.