Math

Log Calculator

Calculate log₁₀, natural log (ln), log₂, and any custom base logarithm for a positive number. All four results display simultaneously.

Enter a positive number to compute its logarithms.

Advertisement

Logarithm Formulas

A logarithm answers: what exponent gives us this number? The change-of-base formula lets you calculate any base from natural log.

log₁₀(n) = log(n) / log(10)

ln(n) = natural log (base e ≈ 2.71828)

log₂(n) = ln(n) / ln(2)

log_b(n) = ln(n) / ln(b) [change-of-base]

Understanding the Change-of-Base Rule

The change-of-base formula is one of the most useful tools for working with logarithms. It states that log base b of n equals the ratio of the logarithms of n and b in any common base. Most scientific calculators provide only log₁₀ and ln, so this formula makes every other base accessible.

Logarithms also obey three key identities that are worth internalising. The product rule states that log(a × b) = log(a) + log(b). The quotient rule states that log(a / b) = log(a) − log(b). The power rule states that log(aⁿ) = n × log(a). These three rules underlie most logarithmic simplifications in algebra and calculus.

The inverse relationship between logarithms and exponents means that e^(ln(x)) = x and 10^(log₁₀(x)) = x for all positive x. This property is used extensively in solving exponential equations, such as finding the time needed for an investment to double at a given interest rate.

Frequently asked questions

What is a logarithm?
A logarithm answers the question: to what power must a base be raised to produce a given number? If log base 10 of 100 equals 2, it means 10 raised to the power 2 equals 100. Logarithms convert multiplication into addition and exponentiation into multiplication, making them invaluable tools in science, engineering, finance, and computing. The three most commonly used logarithms are the common logarithm (base 10), the natural logarithm (base e), and the binary logarithm (base 2).
What is the difference between log and ln?
In most scientific and mathematical contexts, log refers to the base-10 logarithm (common log), while ln refers to the natural logarithm (base e, where e ≈ 2.71828). The natural logarithm arises naturally in calculus and continuous growth models because e is the base of exponential growth. In some fields like pure mathematics and computer science, log may refer to the natural logarithm or base-2 logarithm by convention, so always check the context when reading formulas.
What is log base 2 used for?
The base-2 logarithm (binary logarithm, denoted log₂ or lb) is widely used in computer science and information theory. It gives the number of bits required to represent a number: log₂(1024) = 10 means you need 10 bits to represent 1024 different values. It also appears in algorithm analysis — binary search and divide-and-conquer algorithms have O(log₂ n) time complexity, meaning the number of steps grows as the base-2 logarithm of the input size.
How do you calculate a logarithm with a custom base?
To calculate the logarithm of a number n in any custom base b, use the change of base formula: log base b of n equals ln(n) divided by ln(b), which is the same as log₁₀(n) divided by log₁₀(b). Most calculators only have log₁₀ and ln built in, so this formula is essential for evaluating other bases. For example, log base 5 of 125 equals ln(125) divided by ln(5), which equals 3 because 5³ = 125.
Why is the logarithm undefined for zero or negative numbers?
Logarithms are only defined for positive real numbers because no real power of a positive base can produce zero or a negative number. Raising any positive base to any real exponent always yields a positive result. As the input approaches zero from the positive side, the logarithm approaches negative infinity. For complex-valued inputs, logarithms can be defined using complex analysis, but for real-number purposes the domain is restricted to strictly positive values.
Where are logarithms used in everyday life?
Logarithms appear in many real-world contexts. The Richter scale for earthquakes is logarithmic — each whole number increase represents a tenfold increase in ground motion amplitude. The decibel scale for sound and the pH scale for acidity are also logarithmic. In finance, logarithmic returns (log returns) are used in portfolio analysis because they are time-additive and symmetrical. In medicine, drug dosage calculations and pharmacokinetics frequently use logarithms to model how drug concentrations decay exponentially over time.