๐Ÿ“‰ Logarithm Calculator

log_10(100)2
ln(100)4.60517019

Enter a value x and a base, and this tool calculates the logarithm log_base(x). It also shows the natural logarithm (ln) at the same time. Useful for math homework or for understanding exponential changes like pH, decibels, or earthquake magnitude.

How to use

  1. Enter a value x (a positive number).
  2. Enter a base (a positive number other than 1).
  3. The logarithm with your chosen base, plus the natural logarithm (ln), are calculated automatically.

How the calculation works

A logarithm answers "to what power must the base be raised to get this number?". logโ‚x = y means aสธ = x, where a is the base. This tool computes a logarithm to any base with the change-of-base formula: logโ‚x = ln x รท ln a ln is the natural logarithm, to base e (about 2.71828). The natural log of the input is shown as well. The base must be positive and not 1, and the number must be positive.

Worked example

logโ‚โ‚€100 = 2 (10ยฒ = 100) logโ‚‚8 = 3 (2ยณ = 8) ln 100 โ‰ˆ 4.605 logโ‚‚1,000,000 โ‰ˆ 19.93, so writing a million in binary takes 20 bits. Decibels, earthquake magnitudes and pH are all logarithmic scales.

Things to be aware of

  • Logarithms are undefined for numbers of 0 or less and for a base of 1 or 0 or less.
  • The integer part of logโ‚โ‚€x plus 1 is the number of digits in the integer part of x.
  • Calculations use floating-point numbers, so tiny rounding errors can appear.

FAQ

How do I calculate a common logarithm (logโ‚โ‚€)?

Enter 10 as the base โ€” that's the default setting.

What is the natural logarithm (ln)?

It's the logarithm with Euler's number e (approximately 2.71828) as its base. It's always shown automatically in the result.

What happens if x or the base is 0 or negative?

Logarithms are only defined for positive numbers, so no result is shown for values of 0 or less. A base of 1 also isn't allowed.