Logarithm Calculator
Calculate log₁₀, ln (natural log), log₂, or any custom base logarithm.
📊 What is a Logarithm?
A logarithm is the inverse of exponentiation. If you know that 10³ = 1000, then log₁₀(1000) = 3 - the logarithm tells you what exponent (3) you need to raise the base (10) to in order to get the result (1000). In general: if b^y = x, then log_b(x) = y.
Logarithms were invented in the early 17th century by John Napier as a way to transform multiplication into addition - which was far easier to do by hand for large numbers. Before electronic calculators, log tables were essential tools for astronomers, engineers, and navigators. Today, logarithms remain central to mathematics, science, and engineering.
The common logarithm (log₁₀) is used in chemistry for the pH scale (pH = −log₁₀[H⁺]), in seismology for the Richter scale (each unit represents a 10× increase in wave amplitude), in acoustics for decibels (dB = 10 × log₁₀(power ratio)), and in astronomy for the stellar magnitude scale. Because we count in base 10, log₁₀ is natural for expressing ratios involving powers of 10.
The natural logarithm (ln, base e where e ≈ 2.71828) arises naturally in calculus and differential equations. The derivative of ln(x) is 1/x - a remarkably simple result. It appears in compound interest (continuous compounding), radioactive decay, population growth, and information entropy. The number e itself emerges from the limit of (1 + 1/n)^n as n approaches infinity.
Log base 2 is the workhorse of computer science and information theory. Claude Shannon’s entropy formula uses log₂ to measure information in bits. Binary trees have height proportional to log₂(n). The number of digits needed to represent n in binary is ⌊log₂(n)⌋ + 1.
📐 Formulas
📖 How to Use This Calculator
Steps to Calculate a Logarithm
💡 Example Calculations
Example 1 - pH Calculation using log₁₀
A solution has [H⁺] = 0.001 mol/L. What is its pH?
Example 2 - Binary Storage using log₂
How many bits are needed to represent 4096 unique values?
Example 3 - Continuous Compound Interest using ln
An investment doubles. With continuous compounding at 7% p.a., how long does it take?
Frequently Asked Questions
🔗 Related Calculators
What is a logarithm?
A logarithm answers the question: to what power must a base be raised to produce a given number? If log_b(x) = y, then b^y = x. For example, log₁₀(1000) = 3 because 10³ = 1000. The base-10 logarithm is called the common logarithm and the base-e logarithm (e ≈ 2.71828) is called the natural logarithm (ln).
What is the natural logarithm (ln)?
The natural logarithm, written ln(x), is the logarithm with base e (Euler's number, approximately 2.71828). It appears naturally in calculus, compound interest, population growth, radioactive decay, and many physics equations. ln(e) = 1 and ln(1) = 0.
What is log base 2 used for?
Log base 2 (log₂) is used extensively in computer science and information theory. The number of bits required to represent n items is log₂(n). For example, to store 256 values you need log₂(256) = 8 bits (one byte). Binary search complexity is O(log₂ n).
Why can't you take the log of zero or a negative number?
Logarithms are only defined for positive real numbers. There is no real power to which any positive base can be raised to give 0 or a negative number. As x approaches 0 from the positive side, ln(x) approaches negative infinity. In complex number theory, logarithms of negative numbers are defined, but they involve imaginary components.
How do you convert between logarithm bases?
Use the change of base formula: log_b(x) = log(x) / log(b), where log can be any common base (typically log₁₀ or ln). For example, log₂(50) = log₁₀(50) / log₁₀(2) = 1.69897 / 0.30103 ≈ 5.644.
What is the difference between log and ln?
log (without a specified base) typically refers to log base 10 (common logarithm). ln refers to the natural logarithm, which uses base e (approximately 2.71828). log10(x) asks: 10 to what power gives x? ln(x) asks: e to what power gives x? Natural logarithm appears frequently in calculus, physics, and continuous growth/decay problems. Log base 10 is used in pH chemistry, decibels, and the Richter scale.
What are the logarithm laws?
The four main logarithm laws: (1) Product rule: log(ab) = log(a) + log(b). (2) Quotient rule: log(a/b) = log(a) - log(b). (3) Power rule: log(a^n) = n x log(a). (4) Change of base: log_b(x) = log(x) / log(b) = ln(x) / ln(b). These rules apply to any consistent base. They allow simplification of complex logarithmic expressions and are the basis for solving exponential equations.
What is the logarithm of 0 or a negative number?
The logarithm of 0 is undefined - no real number exponent makes a positive base equal to 0. As x approaches 0 from the positive side, log(x) approaches negative infinity. The logarithm of a negative number is also undefined in the real number system - no real exponent makes a positive base equal to a negative number. In complex number mathematics, logarithms of negative numbers exist but involve imaginary components.