A logarithm is an exponent
Every logarithm is the answer to a power question. "log10(1000)" asks: 10 raised to what gives 1,000? The answer is 3, so log10(1000) = 3. "log2(1024)" asks the same question with base 2, and the answer is 10. Nothing more is going on.
Because logarithms are exponents, they turn multiplication into addition. Multiplying two numbers adds their logarithms, dividing subtracts, and raising to a power multiplies the logarithm by that power. Before electronic calculators, this was the entire point: a table of logarithms and a ruler turned a long multiplication into a short addition, which is what slide rules did mechanically for three centuries.
The reason logarithms still matter is that they compress multiplicative structure into additive structure. Anything that grows or shrinks by repeated multiplication — compound interest, bacterial cultures, radioactive decay, sound intensity, earthquake energy, algorithm cost as data grows — becomes a straight line on a logarithmic scale. Equal distances along a log axis represent equal ratios, not equal differences, so a chart that looks like a wild exponential curve on a linear axis often reveals a simple constant rate on a log axis.
Two restrictions come with the definition. The value must be positive, because a positive base raised to any real power is always positive — there is no exponent that turns 10 into zero or into −5. And the base must be positive and not 1, because 1 raised to anything is still 1, so no exponent could ever get you anywhere else.
The three standard bases and the change-of-base formula
Three bases dominate, and the choice is about convenience, not mathematics.
Base 10, the common log, written log or log10. Its value is roughly the number of digits minus one, which makes it the natural language for orders of magnitude. It underpins pH, which is defined as −log10 of the hydrogen ion activity, and the decibel, defined as 10 log10 of a power ratio — or 20 log10 of an amplitude ratio, since power goes as amplitude squared.
Base e, the natural log, written ln, where e = 2.718281828…. It is the base at which the exponential function is its own derivative, so every continuous growth and decay model in physics, chemistry and finance uses it. Half-lives, continuously compounded returns and Newton's law of cooling are all written with ln.
Base 2, the binary log, written log2 or lb. It counts doublings, which makes it the unit of information — one bit is one binary decision — and the natural measure for divide-and-conquer algorithms, where log2(n) is the number of halvings needed to reduce a list of n items to one.
Any log can be converted to any other by a single division, which is the change-of-base identity: logb(x) = ln x ÷ ln b. The right-hand side can use any base you like, as long as both logs use the same one; base 10 works equally well. This is how a calculator with only ln and log10 buttons produces a logarithm in base 7, and it is what this calculator does internally.
The identity also tells you that all logarithms are proportional to one another. log2(x) is always ln(x) ÷ 0.6931, which is 1.4427 times ln(x), for every x. So the shape of a logarithmic relationship never depends on the base — only the scale does.
Worked example: log base 7 of 200, by change of base
Suppose you need log7(200) and have only natural logs available.
- Take the natural log of the value. ln 200 = 5.298317367.
- Take the natural log of the base. ln 7 = 1.945910149.
- Divide. 5.298317367 ÷ 1.945910149 = 2.72281.
- Check by antilog. 72.72281 = 200.0. The check is the definition applied backwards, and it is worth doing whenever the answer is not a whole number.
- Sanity-check the bracket. 72 = 49 and 73 = 343, so the answer must lie between 2 and 3, and closer to 3 since 200 is nearer 343 than 49 on a multiplicative scale. 2.72 fits.
The same answer through base 10. log10(200) = 2.301030 and log10(7) = 0.845098. Dividing: 2.301030 ÷ 0.845098 = 2.72281. Identical, as the identity promises, because the constant relating the two log scales cancels in the ratio.
Using the log laws instead. 200 = 2 × 100, so log10(200) = log10(2) + log10(100) = 0.30103 + 2 = 2.30103, which is where the number in step 1 of the alternative route comes from. That decomposition — split off the powers of ten, look up the rest — is exactly how printed log tables were used, and it still makes mental estimates easy: any number between 100 and 1,000 has a base-10 log between 2 and 3.
What the number is telling you
Read a logarithm as a count of multiplications. log2(1000) ≈ 9.97 means it takes just under ten doublings to get from 1 to 1,000. log10(1000) = 3 means three tenfold steps. The whole part tells you the order of magnitude; the fractional part locates you between two consecutive powers of the base.
The sign is a comparison with 1. In any base greater than 1, values above 1 have positive logarithms, a value of exactly 1 has a logarithm of zero in every base, and values between 0 and 1 have negative logarithms. That is why pH is defined with a minus sign in front: hydrogen ion concentrations in water are small numbers like 10−7, and flipping the sign turns an awkward −7 into a friendly 7.
Differences on a log scale are ratios on the original scale. A gap of 1 in log10 means a factor of 10; a gap of 0.301 means a factor of 2. This is what makes log axes the right choice for data spanning several orders of magnitude, and it is why an earthquake one point higher on a base-10 magnitude scale represents about ten times the ground-motion amplitude.
Growth rates come out as slopes. If a quantity multiplies by a constant factor each period, its logarithm increases by a constant amount each period, so plotting the log against time gives a straight line whose slope is the growth rate. Fitting that line is more robust than fitting a curve, which is why log plots are standard for anything exponential.
Logarithms of common values in three bases
| x | log10 x | ln x | log2 x |
|---|---|---|---|
| 1 | 0.00000 | 0.00000 | 0.00000 |
| 2 | 0.30103 | 0.69315 | 1.00000 |
| 3 | 0.47712 | 1.09861 | 1.58496 |
| 5 | 0.69897 | 1.60944 | 2.32193 |
| 10 | 1.00000 | 2.30259 | 3.32193 |
| 100 | 2.00000 | 4.60517 | 6.64386 |
| 1,000 | 3.00000 | 6.90776 | 9.96578 |
| 1,000,000 | 6.00000 | 13.81551 | 19.93157 |
Two figures are worth memorising: log₁₀2 = 0.30103, so a doubling is about three tenths of a decade; and log₂10 = 3.32193, so ten doublings is a bit more than three decades — which is why 2¹⁰ = 1,024 sits so close to 1,000.
Mistakes that logarithms invite
- Splitting the log of a sum. log(a + b) has no expansion. Only products, quotients and powers decompose: log(ab) = log a + log b. Writing log(a + b) = log a + log b is wrong for every pair of values except contrived ones.
- Confusing log(x²) with (log x)². The first is 2 log x; the second is the square of the logarithm, an entirely different quantity.
- Taking the log of a negative number or zero. Neither exists in the real numbers. If your data contains zeros, a log transform will drop them silently unless you handle them deliberately.
- Assuming 'log' means base 10. It does in engineering and chemistry, but in pure mathematics and in most programming languages an unqualified
logmeans the natural log, and in computer science it often means base 2. Check before trusting a formula. - Averaging logged values and reporting the mean as if it were on the original scale. Averaging logs and converting back gives the geometric mean, not the arithmetic mean, and the two differ whenever the data varies at all.
- Reading a log-scale chart as if the gridlines were equally spaced in value. They are equally spaced in ratio, so the visual midpoint between 1 and 100 is 10, not 50.
Logarithms next to the tools that undo them
The exact inverse of a logarithm is a power, so the exponent calculator is the other half of this page: whatever logb(x) returns, raising b to it gives x back. Use the exponent tool when you know the rate and want the result, and this one when you know the result and want the rate or the number of periods.
Half of what base-10 logs are for is orders of magnitude, which is also what scientific notation records. The exponent in 6.022 × 1023 is the whole part of the base-10 logarithm, and the scientific notation calculator converts between the forms, including engineering notation in multiples of three. How many of those digits are meaningful is a separate question, handled by the significant figures calculator.
Roots are fractional powers, so they can be computed with logs: the nth root of x is the antilog of (log x) ÷ n. For the commonest case, the square root calculator is more direct and gives exact answers for perfect squares.
Where logarithms turn up in growth problems, the practical question is usually how many periods a compounding process needs, which is a log divided by a log: the percentage increase and decrease calculator handles the forward direction, and taking logs of both sides inverts it. In number theory, the count of digits of a large number is one more than the whole part of its base-10 logarithm, which pairs naturally with the prime factorization calculator and the number base conversion calculator, where log2 gives the bit length directly.
