Logarithm Calculator
Calculate a logarithm to base 10, base e, base 2 or a base you choose.
Logarithm
How we calculated this
Worked example
Inputs: number 8, base 2. Formula: the logarithm of a number to a base is the power the base must be raised to in order to give that number. Substitution: 2 to the power of what gives 8? 2 × 2 × 2 = 8, so the power is 3. Result: log base 2 of 8 is 3.
How it works
The logarithm of a number x to a base b is the power y for which b to the power of y equals x. It exists in the real numbers only when x is greater than 0 and the base is greater than 0 and not 1, so each of those cases is reported separately. For any other base the result is worked out as ln(x) ÷ ln(b), where ln is the natural logarithm. An exact result, such as log base 4 of 8 being exactly 1.5, is shown as a plain number; a rounded one has a leading "≈" (10 significant figures). The working line writes it as an equation with "=" or "≈".
What this result means
The result y is the power to which the base must be raised to give your number: base ^ y = number. A plain number means the digits shown are exact; a leading "≈" means the result is rounded, here to 10 significant figures.
Common mistakes
- Mixing up log and ln. Here the base is always chosen explicitly: 10 is the common logarithm, e is the natural logarithm and 2 is the binary logarithm.
- Expecting the logarithm of zero or of a negative number. Neither exists in the real numbers, however large or small the base.
Assumptions and limitations
- Real logarithms only: the number must be greater than 0, and the base greater than 0 and not equal to 1.
- The constant e can be typed as the letter e, for the number or for a custom base. Other constants such as π cannot be typed.
- A result is marked exact only when the number and base have up to 15 significant digits and the logarithm is provably a whole number or a fraction such as 3/2.
