Logarithms in plain terms: the question a logarithm answers
A logarithm answers one question: what power do I raise this base to, to get this number? Log base 10 of 1,000 is 3, because 10 × 10 × 10 is 1,000. Log base 2 of 1,024 is 10, because ten 2s multiplied together make 1,024. A logarithm undoes a power in the same way that division undoes multiplication.
Three bases come up so often they have their own names. The common logarithm, base 10, counts orders of magnitude: a number with log10 of 6 is a million. The decibel scale for sound and the pH scale for acidity are built on it. The natural logarithm, ln, uses base e, about 2.718281828. It appears wherever growth is continuous, such as compound interest, population growth and radioactive decay. The binary logarithm, base 2, counts halvings and doublings. It tells you that 1,024 items can be searched in 10 steps by halving, and that a number below 256 fits in 8 bits.
A logarithm in any other base comes from the change-of-base rule. Log base b of x equals ln x divided by ln b. To find how many years money takes to double at 7% a year, take log base 1.07 of 2. That is ln 2 divided by ln 1.07, about 10.24 years. The same rule turns a question such as "2 to what power gives 100" into a division: log base 2 of 100 is about 6.644.
Dividing two logarithms on a computer leaves tiny rounding errors. Ln 1,000 divided by ln 10 comes out as 2.9999999999999996 in most programming languages, not 3. This calculator checks whether the answer is within a hair of a whole number and whether the base raised to that whole number gives your number back. If both are true, it shows the exact whole number and says so. Otherwise it rounds to 10 significant digits.
Some limits are worth knowing. The number must be greater than 0, and the base must be greater than 0 and not 1, because no other case has a real answer. The tool does not give complex logarithms. Inputs must fit in an ordinary decimal, which goes up to about 1.8 × 10^308, so a number with more than 308 digits is refused. Results that are not exact are accurate to the 10 significant digits shown.