Math

Log Calculator

Enter a number and a base (10, e for natural log, 2, or any custom base) to calculate the logarithm instantly.

Logarithm

Result
Enter a number and base to calculate.

How the Log formula works

Using the change-of-base formula:

log_base(number) = ln(number) / ln(base)

This lets any base be calculated using natural logarithms, which is how most calculators and programming languages compute logs internally.

Step-by-step calculation

  1. Take the natural logarithm of the number.
  2. Take the natural logarithm of the base.
  3. Divide the first by the second.

Worked example

log base 2 of 32: ln(32)/ln(2) = 3.4657/0.6931 = 5, confirming that 2⁵ = 32.

Frequently asked questions

What's the difference between log and ln?

'log' typically refers to base-10 logarithm (common logarithm), while 'ln' specifically means natural logarithm, which uses the mathematical constant e (≈2.71828) as its base.

Can you take the log of a negative number or zero?

No — logarithms are only defined for positive real numbers, since no real power of a positive base produces a negative result or zero.