The formula
so log_b x = ln x / ln b = log x / log b
Divide the log of the number by the log of the base, using whatever base your calculator has. Both must use the same base k. The conditions are the usual ones for logs: x > 0, b > 0 and b ≠ 1.
Why it works
Let y = log_b x. By definition, bʸ = x. Take the log in base k of both sides: log_k(bʸ) = log_k x. The power rule for logs brings the exponent down: y · log_k b = log_k x. Divide by log_k b, and y = log_k x / log_k b.
Worked examples
1. log₂ 10. ln 10 / ln 2 = 2.302585 / 0.693147 = 3.321928. Check: 2³ = 8 and 2⁴ = 16, so the answer should be between 3 and 4.
2. log₃ 20. With base-10 logs: log 20 / log 3 = 1.301030 / 0.477121 = 2.726833. With ln instead you get the same answer: 2.995732 / 1.098612 = 2.726833.
3. log₅ 125. ln 125 / ln 5 = 3, since 5³ = 125. A calculator may show 3.0000000000000004 because of rounding inside the machine.
4. log₁/₂ 8. ln 8 / ln 0.5 = 2.079442 / (−0.693147) = −3. Bases below 1 give negative logs for numbers above 1: (1/2)⁻³ = 8.
5. Solving 1.05ᵗ = 50. t = log₁.₀₅ 50 = ln 50 / ln 1.05 = 80.1806. This is how long something growing 5% per period takes to grow 50-fold, the same math behind compound interest.
| Logarithm | Using ln | Value |
|---|---|---|
| log₂ 10 | ln 10 / ln 2 | 3.321928 |
| log₂ 100 | ln 100 / ln 2 | 6.643856 |
| log₃ 20 | ln 20 / ln 3 | 2.726833 |
| log₇ 1000 | ln 1000 / ln 7 | 3.549884 |
| log₁₆ 2 | ln 2 / ln 16 | 0.25 |
Counting doublings
Base-2 logs answer "how many times do I double?" Starting from 1, how many doublings does it take to pass 1,000,000? log₂ 1,000,000 = ln 1,000,000 / ln 2 ≈ 19.93, so it takes 20 doublings (2²⁰ = 1,048,576). The same idea tells you how many bits are needed to count to a number, or how many rounds of halving a binary search needs.
On a calculator
- Scientific calculator: type ln(10) ÷ ln(2), or log(10) ÷ log(2). Brackets matter: ln(10/2) is a different number.
- TI-84: newer models have logBASE( in the MATH menu, but log(10)/log(2) works on every model.
- Spreadsheets: =LOG(10, 2) takes the base as its second argument.
Related identities
- log_b a = 1 / log_a b. For example, log₈ 2 = 1/log₂ 8 = 1/3.
- Switching base multiplies by a constant: log₂ x = (1/ln 2) · ln x ≈ 1.442695 · ln x. That's why every log graph has the same shape, just stretched.
- In calculus, d/dx log_b x = 1/(x ln b) follows straight from this formula. See the derivative rules table.
Common mistakes
- Flipping the fraction. It's log of the number over log of the base.
- Writing ln(x/b) instead of ln x / ln b. The log of a quotient is a difference, not this formula.
- Using a base of 1 or a negative base. Those aren't valid log bases.
Find any log, ln or antilog with the log calculator, which has a change-of-base mode. Solve for a missing exponent with the exponent calculator, and review powers in exponent rules.
Sources
- OpenStax College Algebra 2e, 6.5: Logarithmic properties (change-of-base formula)
- OpenStax Intermediate Algebra 2e, 10.4: Use the properties of logarithms
Every worked example on this page was checked independently with SymPy.