Connect via MCP →

Enter Calculation

Formula

Formula: Logarithm Function Calculator
Show calculation steps (1)
  1. Change-of-base formula

    Change-of-base formula: Logarithm Function Calculator

    Logarithm to any base a expressed using natural logs.

Advertisement

Results

Result
1.09861228866811
value of the chosen logarithm at x

What this calculator does

This Logarithm Function Calculator evaluates three common logarithm functions for a positive real number x: the natural logarithm \(\ln(x)\) (base e), the common logarithm \(\log(x)\) (base 10), and the logarithm to any base a, written \(\log_a(x)\). It is a universal math tool with no country or unit assumptions - every input is a plain dimensionless number.

How to use it

Pick a function from the dropdown. For \(\ln(x)\) and \(\log(x)\) you only enter the argument x. For \(\log_a(x)\) also enter the base a (it must be greater than 0 and not equal to 1). Enter x (it must be greater than 0 for a real answer) and read the result, shown to about 14 significant digits.

The formula explained

The natural logarithm answers "e to what power gives x?" and the common logarithm answers "10 to what power gives x?". For an arbitrary base, the calculator uses the change-of-base formula $$\log_a(x) = \frac{\ln(x)}{\ln(a)}$$ This works because logarithms in any base are proportional to one another, so dividing two natural logs cancels the choice of base in the numerator and denominator.

Change-of-base formula shown as a fraction of two natural logs
Change-of-base: any \(\log_a(x)\) equals \(\ln(x)\) divided by \(\ln(a)\).
Logarithmic curves for three different bases on shared axes
Logarithm curves \(y = \log_a(x)\) for bases e, 10, and 2, all passing through \((1, 0)\).

Worked example

Choose \(\log_a(x)\) with base a = 2 and x = 8. Then $$\log_2(8) = \frac{\ln(8)}{\ln(2)} = \frac{2.0794415\ldots}{0.6931472\ldots} = 3$$ because 2 raised to the power 3 equals 8. Similarly \(\log(1000) = 3\) since 10 cubed is 1000, and \(\ln(3)\) is about \(1.0986122886681\).

FAQ

Why must x be greater than 0? A real logarithm is only defined for positive arguments. As x approaches 0 the logarithm tends to negative infinity, and for x at or below 0 there is no real value (the original tool returns a complex principal value instead).

Why can't the base be 1? \(\ln(1)\) is 0, so the change-of-base formula would divide by zero. Base 1 logarithms are undefined.

What is the difference between ln and log? ln is base e (about 2.71828); log here means base 10. They differ by a constant factor: \(\log(x) = \frac{\ln(x)}{\ln(10)}\).

Last updated: