Free online logarithm calculator
A logarithm answers the question "what exponent produces this number?" — log_b(x) = y means b^y = x. This calculator computes log in any base and always shows ln, log₁₀, and log₂.
Expression
—
—
ln (base e)
—
log₁₀
—
log₂
—
How to use
- Enter a positive value (x).
- Select a base — 2, e (natural log), 10, or Custom.
- For a custom base, enter any positive number other than 1.
- The result and expression appear instantly.
The formula
log_b(x) = ln(x) / ln(b) ← change-of-base formula
Where ln is the natural logarithm. Special cases:
- log₂(x): used in computer science and information theory
- ln(x): base e, used in calculus and natural growth models
- log₁₀(x): common log, used in pH, decibels, and the Richter scale
Source: Abramowitz M, Stegun IA. Handbook of Mathematical Functions. 1964. §4.1
Worked examples
log₂(8) = 3 — because 2³ = 8
log₁₀(1000) = 3 — because 10³ = 1000
ln(e) = 1 — because e¹ = e
log₃(27) = 3 — because 3³ = 27
log₅(25) = 2 — because 5² = 25
Notes
- log_b(1) = 0 for any base b (because b⁰ = 1).
- log_b(b) = 1 for any base b (because b¹ = b).
- Logarithms of values between 0 and 1 are negative.
- This calculator shows results to 9 significant figures.
Frequently asked
What is a logarithm?
A logarithm is the inverse of exponentiation. log_b(x) = y means b^y = x. For example, log₂(8) = 3 because 2³ = 8.
What is the natural logarithm (ln)?
The natural logarithm uses base e ≈ 2.71828. It appears in calculus, growth models, and compound interest. ln(e) = 1 and ln(1) = 0.
How is the change-of-base formula used?
log_b(x) = ln(x) / ln(b). This lets any logarithm be computed using natural log. For example, log₂(8) = ln(8) / ln(2) = 2.0794 / 0.6931 = 3.
What inputs are invalid?
The value must be positive (x > 0). The base must be positive and not equal to 1. Logarithms of zero or negative numbers are not real numbers.
Can I use a custom base?
Yes. Select "Custom base" from the drop-down and enter any positive number other than 1.
Related calculators
- Exponent calculator
Compute b^e for any base and exponent, including fractional and negative powers.
- Scientific calculator
Full scientific calculator with trig, logarithms, memory, and keyboard support.
- Square root calculator
Calculate the square root or any nth root of any real number.
- Percentage change calculator
Percentage increase or decrease between any two values.