The Standard Engine.
MathematicsFinanceHealthPhysicsEngineeringBrowse all

Mathematics · Algebra & Calculus

Logarithm Calculator

Calculate the logarithm of any number in any base, including natural log (ln) and common log (log₁₀).

Calculator

Advertisement

Formula

Where x is the argument (the number whose logarithm is taken), b is the base of the logarithm, and ln denotes the natural logarithm. The result is the exponent to which the base b must be raised to produce x.

Source: Abramowitz, M. & Stegun, I. A. (1964). Handbook of Mathematical Functions. National Bureau of Standards, Formula 4.1.18.

How it works

A logarithm answers the question: to what power must the base be raised to produce a given number? Formally, if by = x, then logb(x) = y. For example, since 102 = 100, we have log10(100) = 2. The base b must be a positive real number not equal to 1, and the argument x must be strictly positive; logarithms of zero or negative numbers are undefined in the real number system.

The change-of-base formula — logb(x) = ln(x) / ln(b) — is the engine behind this calculator. Because computers and most programming languages provide efficient implementations of the natural logarithm (base e ≈ 2.71828), any arbitrary-base logarithm can be computed by dividing the natural log of the argument by the natural log of the desired base. The three special cases displayed — ln(x), log10(x), and log2(x) — are the most commonly used in mathematics, engineering, and computer science respectively.

Logarithms appear throughout science and engineering: the Richter scale measures earthquake magnitude logarithmically, the decibel scale measures sound intensity, pH measures hydrogen ion concentration, and Shannon entropy in information theory relies on log2. Understanding logarithms is also essential for solving exponential growth and decay problems, such as compound interest, radioactive decay half-lives, and population dynamics models. The natural logarithm in particular arises naturally in calculus as the integral of 1/t from 1 to x, making it indispensable in continuous mathematics.

Worked example

Suppose you want to find log3(243) — the logarithm of 243 in base 3.

Step 1 — Apply the change-of-base formula:
log3(243) = ln(243) / ln(3)

Step 2 — Compute the natural logarithms:
ln(243) ≈ 5.49306
ln(3) ≈ 1.09861

Step 3 — Divide:
5.49306 / 1.09861 = 5.00000

This confirms the exact result: 35 = 243. As a cross-check, log10(243) ≈ 2.38561 and log2(243) ≈ 7.92481, both of which can be verified with the corresponding inverse operations (102.38561 ≈ 243 and 27.92481 ≈ 243).

Now consider a real-world example: how many doublings does it take to grow a quantity by a factor of 1,000? This is simply log2(1000) ≈ 9.9658, meaning approximately 9.97 doublings are required.

Limitations & notes

This calculator is subject to the standard domain restrictions of the real-valued logarithm: the argument x must be strictly greater than zero, and the base b must be a positive real number not equal to 1. Entering x ≤ 0 or b = 1 will produce undefined or infinite results. For bases very close to 1 (e.g., b = 1.0000001), extreme numerical sensitivity arises due to division by a near-zero value of ln(b), and results may lose precision. In complex analysis, logarithms can be extended to negative and complex numbers using the complex logarithm, which is multi-valued and not covered here. Additionally, floating-point arithmetic limits precision to approximately 15–17 significant digits; for applications requiring arbitrary-precision arithmetic, a dedicated computer algebra system such as Wolfram Alpha or SageMath should be used.

Frequently asked questions

What is the difference between log, ln, and log₂?

These three notations refer to logarithms with different bases. 'log' (or log₁₀) is the common logarithm with base 10, widely used in chemistry and everyday scientific notation. 'ln' is the natural logarithm with base e ≈ 2.71828, ubiquitous in calculus, continuous growth models, and pure mathematics. 'log₂' is the binary logarithm with base 2, the standard in computer science, information theory, and algorithm complexity analysis.

Why is the logarithm of a negative number undefined?

In the real number system, no real exponent y can satisfy b<sup>y</sup> = x when x is negative, because any positive base raised to a real power always yields a positive result. Therefore, log<sub>b</sub>(x) has no real-valued solution for x ≤ 0. The complex logarithm extends this to negative inputs by introducing imaginary components, but this is beyond the scope of standard real-valued calculators.

What does it mean for a logarithm to be negative?

A negative logarithm simply means the argument x is between 0 and 1 (exclusive). For instance, log<sub>10</sub>(0.01) = −2 because 10<sup>−2</sup> = 0.01. This is perfectly valid and arises frequently in practice — for example, a pH of 7 indicates a hydrogen ion concentration of 10<sup>−7</sup> mol/L, and −log₁₀(10<sup>−7</sup>) = 7.

How is the change-of-base formula derived?

Start with the definition: if y = log<sub>b</sub>(x), then b<sup>y</sup> = x. Taking the natural logarithm of both sides gives ln(b<sup>y</sup>) = ln(x), and by the power rule of logarithms, y · ln(b) = ln(x). Dividing both sides by ln(b) yields y = ln(x) / ln(b), which is the change-of-base formula. Any logarithm base can be substituted for ln, making this a general conversion tool between any two logarithmic bases.

What are the key logarithm laws I should know?

The three fundamental laws are: (1) the <strong>product rule</strong> — log<sub>b</sub>(xy) = log<sub>b</sub>(x) + log<sub>b</sub>(y); (2) the <strong>quotient rule</strong> — log<sub>b</sub>(x/y) = log<sub>b</sub>(x) − log<sub>b</sub>(y); and (3) the <strong>power rule</strong> — log<sub>b</sub>(x<sup>n</sup>) = n · log<sub>b</sub>(x). These identities are essential for simplifying logarithmic expressions, solving exponential equations, and transforming multiplicative relationships into additive ones for easier analysis.

Last updated: 2025-01-15 · Formula verified against primary sources.