Logarithm calculator: log base 10, ln, log₂ and any base
Calculate the logarithm of a positive number in base 10, base e, base 2 or any base you choose, with all three common logarithms side by side and a check that raises the base back to the result.
Input
Tip: press Ctrl + Enter to run
Saved settings
About this tool
A logarithm answers “what power do I raise the base to, to get this number?”. This calculator gives that answer in base 10, base e, base 2 or any base you choose, and lists the three common logarithms side by side. It is useful for algebra and chemistry homework, decibels and pH, the number of bits needed for a value, and working out how long something takes to double at a steady growth rate.
How to use it
- Enter the number x. It must be greater than 0.
- Pick base 10, base e (the natural log, ln), base 2, or “another base”.
- For another base, type it in the last field, for example 1.07 for 7% growth. The base must be positive and not 1.
- Run it to see the logarithm, ln, log₁₀ and log₂ of x, and a check that raises the base to the result.
How the calculation works
Any logarithm can be written with natural logs: log_b(x) = ln(x) ÷ ln(b). The tool computes it that way using the browser’s double-precision maths, shows up to ten decimal places and then raises the base to the result so you can see that it returns x. Very small rounding differences in the last digit are normal for floating-point arithmetic.
log_b(x) = ln(x) ÷ ln(b), for x > 0, b > 0, b ≠ 1Worked example
An investment grows 7% a year and you want to know how long it takes to double. The answer is log base 1.07 of 2, which is 10.2447683511 years, a little over ten years. The check line confirms that 1.07 raised to that power gives back 2. For comparison, ln 2 is 0.6931471806 and log₁₀ 2 is 0.3010299957.
Sample input and result
log₁₀(1000) = 3; log₂(1024) = 10; ln(e²) = 2
Limitations
- Real logarithms only. Logs of zero, negative numbers and complex results are not supported.
- Precision is limited to about 15 significant digits, the same as a spreadsheet.
- Inputs larger than 10³⁰⁰ are rejected to stay within floating-point range.
Last updated:
Frequently asked questions
What is the difference between log and ln?
On most calculators log means base 10 and ln means base e (about 2.71828). In some maths and programming texts, log alone means the natural log.
Why can’t I take the log of 0 or a negative number?
No positive base raised to a real power gives 0 or a negative number, so the logarithm is not defined there for real numbers.
Is log on my calculator base 10 or base e?
On most calculators the log key is base 10 and ln is base e. In many programming languages, log() means the natural logarithm, so check the documentation before comparing results.
How do I undo a logarithm?
Raise the base to the answer: if log₁₀(x) = 3, then x = 10³ = 1000. The scientific calculator can evaluate powers like 10^3 directly.
What is the rule of 72?
It is a shortcut for doubling time: 72 ÷ 7 ≈ 10.3 years at 7%. The exact answer from logarithms here is 10.24 years, so the shortcut is close for typical rates.
Troubleshooting
It says the number must be greater than 0.
Logarithms of 0 and negative numbers are not defined for real numbers. Check for a stray minus sign.
It says the base is not allowed.
The base must be greater than 0 and not equal to 1, because 1 raised to any power is always 1.
My answer is 2.9999999999 instead of 3.
That is floating-point rounding. The displayed result is rounded to ten decimals, which normally hides it.
Privacy & Free to use
Are my inputs stored?
Your inputs stay in this tab. We do not receive your files, pasted text or calculation values.
Is this tool free?
Yes. No signup or payment is required.
See also
Useful next steps
Scientific calculator
Evaluate arithmetic, powers and trigonometric functions in radians without eval.
Maths & educationFraction calculator
Add, subtract, multiply or divide rational numbers exactly.
Maths & educationEquation solver
Solve real linear and quadratic equations ax² + bx + c = 0.
Maths & education