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₂.
Saved to favorites
Your favorites are on the home page under “Your favorites.” They are saved only in this browser on this device, so they will not appear on another device or browser. No account, no server.
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.
References
Frequently asked
What is a logarithm?
What is the natural logarithm (ln)?
How is the change-of-base formula used?
What inputs are invalid?
Can I use a custom base?
Embed this calculator
Add this free calculator to your own site. Copy the snippet — it works anywhere you can paste HTML, and stays in sync with this page.
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.