The Logarithm Calculator finds the logarithm of any number in any base — including the common logarithm (base 10), the natural logarithm (base e ≈ 2.71828), and any custom base you choose. A logarithm answers the question: “What exponent do I need to raise the base to, in order to get this number?” For example, log₁₀(1000) = 3 because 10^3 = 1000.
Logarithms are the inverse operation of exponentiation. They appear throughout mathematics, science, and engineering — from measuring earthquake magnitude on the Richter scale and sound intensity in decibels, to calculating the time needed for an investment to double (the Rule of 72 relies on logarithms), to training machine learning models and analyzing data that spans many orders of magnitude.
This calculator handles log base 10, natural log (ln), log base 2, and any other base. Just enter the number and select or enter the base. The tool shows the result instantly along with the verification (base^result = original number).
Logarithm Calculator
How Logarithms Work
The logarithm log_b(x) asks: “To what power must we raise b to get x?” The answer is the exponent. The change of base formula lets us calculate any logarithm using natural log or log base 10: log_b(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b). This is how the calculator handles any base — it uses JavaScript’s built-in Math.log() (which is the natural log) and divides by Math.log(base).
Example Calculations
log₁₀(100) = 2 (because 10^2 = 100). log₁₀(1,000,000) = 6. ln(e^5) = 5. log₂(64) = 6 (because 2^6 = 64). log₃(81) = 4 (because 3^4 = 81). log₁₀(0.001) = −3 (because 10^−3 = 0.001 — negative results indicate fractions).
Common Logarithm Reference Table
| Expression | Result | Meaning |
|---|---|---|
| log₁₀(10) | 1 | 10^1 = 10 |
| log₁₀(100) | 2 | 10^2 = 100 |
| log₂(8) | 3 | 2^3 = 8 |
| ln(e) | 1 | e^1 = e |
| ln(1) | 0 | e^0 = 1 |
| log₅(125) | 3 | 5^3 = 125 |
Frequently Asked Questions
What is the difference between log and ln?
In everyday math and science, “log” typically means log base 10 (common logarithm), while “ln” means the natural logarithm with base e ≈ 2.71828. In higher mathematics, “log” sometimes means natural log. This calculator clearly labels both options to avoid confusion.
Can you take the log of a negative number or zero?
No. The logarithm is only defined for positive numbers. log(0) is undefined (it approaches −∞ as x approaches 0), and the logarithm of a negative number requires complex numbers, which goes beyond basic real-number arithmetic.
Where is log base 2 used?
Log base 2 (binary logarithm) is used in computer science and information theory. It tells you the number of bits needed to represent a value. For example, log₂(256) = 8, which means you need 8 bits to represent 256 distinct values — that is why a byte (8 bits) can store values from 0 to 255.
What are logarithms used for in real life?
Logarithms are used to measure earthquake magnitude (Richter scale), sound intensity (decibels), pH levels in chemistry, star brightness in astronomy, and data compression in computing. They also appear in finance for calculating doubling time (the Rule of 72 is a simplified logarithm approximation).
What is the relationship between exponents and logarithms?
Logarithms and exponents are inverse operations, just like multiplication and division. If b^n = x, then log_b(x) = n. This means every exponent equation can be written as a logarithm equation and vice versa. The exponent calculator and logarithm calculator are mirror-image tools.