Logarithm calculator
Enter a number and a base to get its logarithm. Type e as the base for the natural logarithm. The tool also lists ln, log10 and log2 of the same number, and an antilog mode turns a logarithm back into the number.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Choose Logarithm or Antilog.
- Enter the value and the base. Use
e as the base for natural logarithms.
- The main result is shown big. In log mode, ln, log10 and log2 of the same number are listed below it.
How it works
The result is ln(x) divided by ln(b), computed with double-precision floating point and shown with 12 significant digits (15 for antilogs). When the quotient is within rounding noise of a whole number k and b^k really equals x, the whole number is shown.
Worked examples
- log10(1000) = 3, because 10^3 = 1000.
- log base 2 of 8 = 3, and log base 5 of 0.2 = -1, because 5^-1 = 0.2.
- ln(100) = 4.60517018599 and log2(100) = 6.64385618977.
- Antilog with base 2 and y = 10: 2^10 = 1024.
Useful identities
- log(a × b) = log(a) + log(b); log(a / b) = log(a) − log(b).
- log(a^n) = n × log(a).
- log_b(b) = 1 and log_b(1) = 0 for every valid base.
Frequently asked questions
What is a logarithm?
The logarithm of x to base b is the power you must raise b to in order to get x. Since 2^3 = 8, log base 2 of 8 is 3. Logarithms turn multiplication into addition, which is why they appear in scales such as decibels, pH and the Richter magnitude.
What is the difference between ln, log10 and log2?
They are logarithms with different bases. ln uses e, about 2.71828 (the natural logarithm), log10 uses 10 (the common logarithm) and log2 uses 2 (the binary logarithm). All three are listed for your number, and any other base can be typed directly.
How do I calculate a logarithm with another base?
Use the change-of-base formula, log_b(x) = ln(x) / ln(b). The calculator does this for you and snaps results that are whole numbers within rounding error, so log base 3 of 81 shows 4 rather than 4.000000000000001.
What is an antilog?
The antilogarithm undoes a logarithm: if log_b(x) = y then x = b^y. In antilog mode, enter y and the base, and the result is b^y. The 10^y and e^y values are shown as well.
Why can I not take the log of zero or a negative number?
No power of a positive base ever gives zero or a negative number, so the real logarithm does not exist there. The calculator reports an error instead. A base of 1 is also not allowed because every power of 1 is 1.