Log Calculator
Base
Result2.000000
A logarithm answers the question: to what power must a base be raised to produce a given number? This calculator computes the logarithm of any positive value in any valid base, including the common log (base 10) and the natural log (base e). Logarithms turn multiplication into addition and underpin pH, decibels, the Richter scale, and exponential growth models.
Formula
log_b(x) = ln(x) / ln(b)
- x
- The value you take the logarithm of (must be positive)
- b
- The base (positive and not equal to 1)
- ln
- Natural logarithm, used internally for the change of base
How it works
- Enter the value (the number you want the log of) and the base. The value must be positive, and the base must be positive and not equal to 1.
- The calculator uses the change-of-base relationship, dividing the natural log of the value by the natural log of the base, so any base is supported.
- The result is the exponent to which the base must be raised to obtain your value. Invalid inputs, such as a non-positive value or a base of 1, return no result.
Worked examples
Compute the logarithm of 8 in base 2.
- Apply change of base: ln(8) / ln(2).
- ln(8) is about 2.0794 and ln(2) is about 0.6931.
- 2.0794 / 0.6931 = 3, since 2 to the power 3 equals 8.
log base 2 of 8 is 3.
Compute the common logarithm of 1000 (base 10).
- Apply change of base: ln(1000) / ln(10).
- ln(1000) is about 6.9078 and ln(10) is about 2.3026.
- The quotient is 3, since 10 to the power 3 equals 1000.
log base 10 of 1000 is 3 (shown as essentially 3 due to floating-point rounding).
Frequently asked questions
- What is the difference between log and ln?
- By convention log usually means base 10 (the common log), while ln means base e, approximately 2.71828 (the natural log). This calculator lets you set any base, so it handles both.
- Why must the value be positive?
- 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 returns no answer.
- Why can the base not be 1?
- A base of 1 raised to any power is always 1, so it cannot produce other numbers and the logarithm is undefined. The base must also be positive for the same reason values must be positive.
- What does the change-of-base formula do?
- It lets you compute a log in any base using natural logs: log base b of x equals ln(x) divided by ln(b). This is how the calculator supports arbitrary bases from a single underlying function.