log_b(x) = ln(x) / ln(b)The logarithm of x in base b is defined as the exponent to which b must be raised to equal x. Using the change-of-base formula, log_b(x) = ln(x) / ln(b), any logarithm can be computed from the natural logarithm. The natural log uses Euler's number e ≈ 2.71828 as the base. The common log uses base 10. The binary log uses base 2.
Enter a number and select a base to see the logarithm. All four bases (10, e, 2, and custom) are shown at once.
Enter any positive number and choose your base to see the logarithm. All four bases (10, e, 2, and custom) are shown at once. Useful for science, computing, information theory, and any field that uses exponential scales.
A logarithm answers the question: "what power do I raise the base to in order to get this number?" If 10^2 = 100, then log₁₀(100) = 2. The concept extends to any positive base and any positive input. Three bases dominate practical use. Base 10 (common log) is used for pH, decibels, and earthquake magnitudes. Base e (natural log) appears throughout calculus, statistics, and physics. Base 2 (binary log) is fundamental to information theory and computing, where it counts the number of bits needed to represent a value. This calculator shows all four simultaneously. The underlying math uses the change-of-base formula: log_b(x) = ln(x) / ln(b), so every result is derived from the natural log.
You came here because
Common situations
- pH and chemistry: pH = -log₁₀[H⁺] where [H⁺] is the hydrogen ion concentration. Enter the concentration to find pH, or check how pH relates to concentration.
- Decibels in audio and acoustics: Sound intensity in decibels: dB = 10 × log₁₀(I/I₀). Enter the intensity ratio to compute decibels.
- Binary information content: The number of bits needed to represent n equally likely outcomes is log₂(n). For 256 colors: log₂(256) = 8 bits, confirming 8-bit color.
- Exponential growth and decay: Solving for time in exponential models like A = A₀ × e^(kt) requires the natural log. Enter A/A₀ and compute ln to find the exponent.
Under the hood
How the calculation works
- 1Enter the positive number you want to find the logarithm of.
- 2Select the primary base: 10, e, 2, or custom.
- 3For a custom base, enter the base value in the custom base field.
- 4The calculator computes the natural log of x first, then divides by the natural log of each base.
- 5All four logarithm values are displayed regardless of the selected primary base.
Show me
A real example
Example: log of 1000 in base 10
- 1x = 1000
- 2ln(1000) = 6.90776
- 3ln(10) = 2.30259
- 4log₁₀(1000) = 6.90776 / 2.30259 = 3
- 5ln(1000) ≈ 6.908
- 6log₂(1000) = 6.90776 / 0.69315 ≈ 9.966
Watch out for
What can go wrong
- Logarithm of zero or negative numbers: log(0) is negative infinity, and the log of a negative number is undefined in real numbers. The calculator only accepts positive inputs. If you have a negative value, consider whether you should use its absolute value.
- Confusing ln and log: In engineering and science, "log" often means base 10. In mathematics and many textbooks, "log" means natural log (base e). This calculator shows both explicitly to avoid ambiguity.
- Using base 1 for a custom log: The base 1 is invalid for logarithms: 1^y = 1 for all y, so there is no unique y that satisfies 1^y = x for x ≠ 1. The calculator returns an error for base 1.
- Forgetting the change-of-base formula: When computing log_5(125) by hand, use log_5(125) = ln(125)/ln(5) = 4.828/1.609 = 3. Enter 125 with custom base 5 in this calculator to verify.
Glossary
Related concepts
| Term | Definition |
|---|---|
| Logarithm | The inverse of exponentiation. If b^y = x, then log_b(x) = y. The base b must be positive and not equal to 1. The input x must be positive. |
| Natural logarithm (ln) | The logarithm with base e (Euler's number, approximately 2.71828). It arises naturally in calculus as the integral of 1/x. Most scientific and engineering log calculations use ln. |
| Change-of-base formula | log_b(x) = log_a(x) / log_a(b) for any valid base a. This allows any logarithm to be computed from any other. Most calculators use natural log (a = e) as the internal base. |
| Euler's number (e) | The mathematical constant approximately equal to 2.71828. It is the base of the natural logarithm and arises in compound interest, population growth, and many differential equations. |
Make it better
Pro tips
- Use base 10 for order-of-magnitude estimates: The integer part of log₁₀(x) tells you how many digits the number has. log₁₀(1,500,000) ≈ 6.18, so it is a 7-digit number. Quick sanity checks for large numbers.
- Use ln for continuous growth problems: When a problem involves e^x (compound interest with continuous compounding, radioactive decay, etc.), the inverse uses ln. ln(A/A₀) = kt gives you time directly.
- Binary log for information theory: log₂(n) gives the number of bits needed to distinguish n equally likely outcomes. This is Shannon entropy for uniform distributions and the basis for compression analysis.
- Verify: log_b(b) always equals 1: A quick sanity check: the log of any base to itself is always 1, because b^1 = b. Enter any base and set the value equal to the base. The result should be exactly 1.
Common questions
Frequently asked questions
For related calculations, try the Exponent Calculator, Standard Deviation, or Percentage Calculator. Browse all Calculator Online calculators for the full catalog.
Methodology
This calculator uses the standard log calculator formula. Results match those from established financial, scientific, and health references.
Reviewed by
Calculator Online Editorial Team. All formulas verified against authoritative sources before publication.
Last updated
2026-05-24
Sources & References
- Weisstein, Eric W., Logarithm (MathWorld)
Mathematical reference for logarithm definitions, properties, and identities.
- NIST Digital Library of Mathematical Functions, Logarithm Function
Authoritative reference for logarithm functions and the change-of-base formula.
- Khan Academy, Introduction to Logarithms
Step-by-step introduction to logarithms for students.