What is a logarithm?
A logarithm is the inverse of an exponent. The statement log_b(x) = y means exactly the same as b^y = x: the logarithm is the power you must raise the base b to in order to get x. Because 103 = 1000, log₁₀(1000) = 3 — the calculator's default example.
Three bases are so common that they have their own names:
| Base | Name | Written | Typical use |
|---|---|---|---|
| 10 | common logarithm | log or log₁₀ | decibels, pH, Richter scale, orders of magnitude |
| e ≈ 2.71828 | natural logarithm | ln | growth and decay, calculus, continuous interest |
| 2 | binary logarithm | log₂ or lb | computer science, bits, halving and doubling |
The logarithm is only defined for positive numbers x and for a positive base other than 1. The log of 1 is always 0 in any base, the log of a number between 0 and 1 is negative, and log_b(b) = 1.
The change-of-base formula and log rules
Calculators usually only have ln and log₁₀ keys. Any other base is reached with the change-of-base formula:
log_b(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b)
For example, log₃(100) = ln 100 / ln 3 = 4.60517 / 1.09861 ≈ 4.19181. Check: 34.19181 ≈ 100.
The rules below follow directly from the laws of exponents and make many problems easier:
- Product: log_b(xy) = log_b(x) + log_b(y)
- Quotient: log_b(x/y) = log_b(x) − log_b(y)
- Power: log_b(x^k) = k · log_b(x)
- Reciprocal base: log_b(x) = 1 / log_x(b)
The power rule is the key to solving exponential equations. To find how many years it takes money growing at 5% a year to double, solve 1.05^n = 2: n = ln 2 / ln 1.05 ≈ 14.2 years.
Solving for the number or the base
The calculator can also run the relationship backwards.
- Solve for x (antilogarithm): if log_b(x) = y, then x = b^y. With base 10 and y = 2.5, x = 102.5 ≈ 316.228.
- Solve for the base: if log_b(x) = y, then b^y = x, so b = x^(1/y). For log_b(81) = 4, the base is 81^(1/4) = 3.
The graph below the result shows the curve y = log_b(x). Every logarithm curve passes through (1, 0) and (b, 1). With a base greater than 1 it rises ever more slowly: each time x doubles, y increases by the same fixed step, log_b(2). That is why logarithmic scales are used to plot quantities that span many orders of magnitude, such as sound intensity or earthquake energy.
The number of digits in a positive whole number n is ⌊log₁₀ n⌋ + 1, which the calculator also reports.
Frequently asked questions
What is the difference between log and ln?
ln is the natural logarithm with base e ≈ 2.71828. log usually means base 10 on calculators and in science, but in pure mathematics and some programming languages log means the natural log. Check the base when in doubt.
Why can't I take the log of zero or a negative number?
A positive base raised to any real power is always positive, so no real exponent can produce 0 or a negative number. Those logarithms are undefined among the real numbers.
Why can't the base be 1?
1 raised to any power is 1, so log₁(x) would have no answer for x ≠ 1 and infinitely many answers for x = 1. Bases must be positive and not equal to 1.
How do I calculate log base 2 on a normal calculator?
Divide the natural log of the number by ln 2 (≈ 0.693147), or the common log by log 2 (≈ 0.30103). For example log₂(1000) = 3 / 0.30103 ≈ 9.96578.
Last reviewed: