Logarithm Calculator
Logarithm Calculator – log, ln, log₂, and Custom Base
This free online logarithm calculator computes four logarithm values simultaneously: the common logarithm (log₁₀), the natural logarithm (ln), the binary logarithm (log₂), and any custom base you specify. Enter a positive number and get all results instantly, with the full change-of-base formula shown.
What Is a Logarithm?
A logarithm answers the question: "To what power must the base be raised to produce this number?" If b^y = x, then log_b(x) = y. For example, log₁₀(1000) = 3 because 10³ = 1000. Logarithms are the inverse of exponential functions, much like subtraction is the inverse of addition.
The Three Common Logarithm Bases
- Base 10 (log₁₀ or "log"): The common logarithm. Used in pH scales, the Richter scale for earthquakes, and decibel (dB) sound levels. log₁₀(100) = 2, log₁₀(1000) = 3.
- Base e (ln, natural logarithm): Where e ≈ 2.71828. Used in calculus, exponential growth and decay, probability, and information theory. ln(e) = 1, ln(1) = 0.
- Base 2 (log₂, binary logarithm): Used in computer science, information theory, and algorithm complexity. log₂(8) = 3, log₂(1024) = 10.
Change of Base Formula
Any logarithm can be computed using the natural log: log_b(x) = ln(x) / ln(b). This is how the custom base calculation works in this tool — it uses JavaScript's native Math.log() (which computes ln) and divides by ln(b). For example, log_3(81) = ln(81) / ln(3) = 4.394 / 1.099 = 4.
Real-World Applications of Logarithms
- pH scale: pH = −log₁₀([H⁺]). A pH of 7 means [H⁺] = 10⁻⁷ mol/L.
- Decibels: dB = 10 × log₁₀(P₂/P₁). Sound intensity comparison.
- Richter scale: Each integer step represents a 10× increase in amplitude.
- Compound interest: Time to double = ln(2) / ln(1 + r), where r is the interest rate.
- Algorithm complexity: Binary search runs in O(log₂ n) time.
- Radioactive decay: t½ = ln(2) / λ, where λ is the decay constant.
