๐ Logarithm Calculator
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
- Enter a value x (a positive number).
- Enter a base (a positive number other than 1).
- 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.