Logarithm Calculator

Enter a number and a base to calculate the logarithm. The natural log and the base 10 and base 2 logs are shown too.

The number you want the log of. It must be above 0.

The base of the logarithm. Use 10 for the common log, 2 for binary, or 2.718281828 for the natural log.

This result is an estimate only. Double-check important figures before relying on them.

How it is calculated

  • log base b of x = ln(x) ÷ ln(b)
  • ln is the natural log, to base e
  • log₁₀ and log₂ use base 10 and base 2
  • Results are rounded to 12 significant digits and shown to 6 decimal places

To go the other way, use the exponent calculator. For compound growth over time, use the compound interest calculator.

Worked example

  • log₁₀(1,000) = 3, because 10³ = 1,000
  • log₂(8) = 3, because 2³ = 8
  • ln(1,000) = 6.907755

Why your number may differ

Computers work with limited precision, so a result that should be exact may differ in the last digits, which is why the value is rounded.

Frequently asked questions

What is a logarithm?

The logarithm log base b of x is the power you must raise b to in order to get x. Since 10³ = 1,000, log₁₀(1,000) = 3.

What is the natural log?

ln(x) is the logarithm to base e, where e is about 2.71828. It appears in growth, decay and compound interest.

Why must x be above 0?

No power of a positive base gives zero or a negative number, so the logarithm of 0 or a negative number is not a real number.