Understanding logarithms
A logarithm answers the question: "What power do I raise the base to in order to get this number?" For example, log₂(8) = 3 because 2³ = 8. Logarithms are the inverse of exponents and appear everywhere—from measuring sound intensity (decibels) and earthquake strength (Richter scale) to calculating compound interest and algorithm complexity in computer science.
This calculator finds the logarithm of any positive number in any base you choose, and also computes the two most common forms: natural logarithm (base e) and common logarithm (base 10).
The formula
logₑ(x) = ln(x) or log₁₀(x) or logᵦ(x) = ln(x) / ln(b)
The most practical form uses the change-of-base rule: to find the logarithm in any base, divide the natural logarithm of your number by the natural logarithm of your base. Most calculators only have buttons for ln and log₁₀, so this rule lets you compute any base.
Worked example
Find log₅(125):
- Identify your inputs: x = 125, base b = 5
- Calculate ln(125) = 4.8283 (natural log of 125)
- Calculate ln(5) = 1.6094 (natural log of 5)
- Divide: 4.8283 ÷ 1.6094 = 3
- Result: log₅(125) = 3
Verify: 5³ = 125 ✓
Find ln(20):
- Enter x = 20, base = e (or select "natural log")
- Calculate: ln(20) = 2.9957
- Result: ln(20) ≈ 2.996
Verify: e^2.996 ≈ 20 ✓
Find log₁₀(1000):
- Enter x = 1000, base = 10 (or select "common log")
- Calculate: log₁₀(1000) = 3
- Result: log₁₀(1000) = 3
Verify: 10³ = 1000 ✓
Common mistakes to watch
Negative or zero inputs: Logarithms of zero and negative numbers are undefined in real mathematics. Always enter a positive number.
Base of 1: log₁(x) is undefined because 1 raised to any power always equals 1—there's no unique answer. Bases must be positive and not equal to 1.
Confusing ln and log: In pure mathematics and science, "log" often means natural log (ln). In engineering and many calculators, "log" means base 10. This calculator lets you choose, so be intentional about which you need.
Forgetting the change-of-base rule: If your calculator only has ln and log₁₀ buttons but you need log₃(81), use logₓ(81) = ln(81) / ln(3) = 4.3944 / 1.0986 = 4. (Verify: 3⁴ = 81 ✓)
Mixing up the order: In logᵦ(x), the base b goes in the denominator of the change-of-base formula: ln(x) / ln(b), not the other way around. Reversing it gives you 1 / your answer.
Rounding too early: If you're chaining calculations, keep full precision in intermediate steps and round only at the end. Rounding ln(125) to 4.83 and ln(5) to 1.61 gives 4.83 / 1.61 ≈ 3.00, but starting with more decimals ensures accuracy.
Tips for real-world use
Logarithms compress large ranges into manageable numbers. The pH scale (measuring acidity) uses log₁₀; the decibel scale (sound) uses log₁₀; and half-lives in radioactive decay use natural log. If you're working with exponential growth (population, bacteria, investments) or decay (radioactive material, cooling), logarithms help you solve for time or rate. For instance, if you know an investment doubles every 7 years, natural log helps you find the annual growth rate. Always verify your result by raising the base to your answer—you should recover the original number (within rounding error).