Logarithm Calculator
Enter a value and a base to compute its logarithm using the change-of-base rule. The natural log (ln), base-10 log and base-2 log of the value are shown alongside for quick reference.
How to calculate a logarithm
- Enter the value you want the logarithm of (it must be greater than 0).
- Enter the base (greater than 0 and not equal to 1).
- Read log to your base, plus ln, log base 10 and log base 2.
Examples
Log base 2 of 8
value = 8, base = 2
3
Log base 10 of 1000
value = 1000, base = 10
3
Frequently asked questions
What is a logarithm?
A logarithm answers the question: to what power must the base be raised to get the value? So log base 2 of 8 is 3 because 2 to the power 3 is 8. It is the inverse operation of raising a base to a power.
What is the change-of-base formula?
To find a logarithm to any base, divide two natural or base-10 logs: log base b of x equals ln(x) divided by ln(b). This tool uses that rule, which is why it can handle any positive base, not just 2, e or 10.
What is the difference between ln, log and lg?
ln is the natural logarithm with base e (about 2.718). In many contexts log written without a base means base 10, and lg is sometimes used for base 2 in computer science. This tool shows ln, log base 10 and log base 2 together so there is no ambiguity.
Why must the value be greater than zero?
Logarithms are only defined for positive numbers because no real power of a positive base produces zero or a negative result. Entering zero or a negative value is therefore rejected rather than returning a misleading answer.
Why can the base not be 1?
A base of 1 raised to any power is always 1, so it can never equal any other value. That makes log base 1 undefined, which is why the base must be greater than zero and different from 1.
Related tools
Exponent Calculator
Raise any base to any power online. Handles negative and fractional exponents, shows the result with scientific notation, and updates instantly.
Scientific Notation Converter
Convert numbers to and from scientific notation and E notation. Enter a number or a value like 1.23 x 10^4 to see the standard decimal form. Free and private.
Factorial Calculator
Calculate the factorial of any non-negative integer with exact big-number precision. Get n! instantly, even for large values, then copy the result. Free.
Area Calculator
Find the area of a circle, square, rectangle, triangle, trapezoid, parallelogram, ellipse, sector or rhombus. Free and runs in your browser.
Arithmetic Sequence Calculator
Find the nth term, the sum of n terms and the full term list for any arithmetic or geometric sequence. Enter the first term, step or ratio, and n.
Average Calculator
Find the mean, median, mode, range, sum, count, min and max of a list of numbers. Paste values separated by commas, spaces or new lines.