DigitHelm

Logarithm Calculator | Log & Ln

Calculate logarithms with any base. Supports natural log (ln), log base 10, and custom bases.

Mode

Presets

Common Logarithm Reference Table

xlog₁₀(x)ln(x)log₂(x)
1000
20.301030.6931471
30.4771211.0986121.584963
40.602061.3862942
50.698971.6094382.321928
60.7781511.7917592.584963
70.8450981.945912.807355
80.903092.0794423
90.9542432.1972253.169925
1012.3025853.321928
10024.605176.643856
100036.9077559.965784

What Is the Logarithm Calculator | Log & Ln?

This calculator evaluates logarithms in any base using four modes: evaluate logᵦ(x), find the base b given the result and argument, find the argument x given base and result, and demonstrate the change-of-base formula step by step.

  • Four modes, evaluate, find base, find argument, and change of base, covering every logarithm problem type.
  • Custom base support, beyond the standard log₁₀, ln, and log₂, enter any positive base other than 1.
  • Related values panel, every evaluation shows all three standard bases (log₁₀, ln, log₂) simultaneously for comparison.
  • Step-by-step derivation, collapsible panel shows each intermediate calculation including the change-of-base substitution and verification.
  • Preset examples, six pre-loaded examples covering common homework and exam problem types.
  • localStorage persistence, your last inputs are restored automatically on return.

Formula

Definition

logᵦ(x) = y means b^y = x  (b > 0, b ≠ 1, x > 0)

Change of Base Formula

logᵦ(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b)

Common Bases

log₁₀(x), common logarithm (written log x)

ln(x) , natural logarithm (base e ≈ 2.71828)

log₂(x) , binary logarithm (computer science)

SymbolNameDescription
bBaseMust be positive and not equal to 1
xArgumentMust be positive (x > 0); log is undefined for x ≤ 0
yLogarithmThe power to which b must be raised to produce x
eEuler's numbere ≈ 2.71828…, the base of the natural logarithm
lnNatural logLogarithm base e, inverse of the exponential function eˣ
logCommon logLogarithm base 10, used in engineering and pH chemistry
log₂Binary logLogarithm base 2, used in information theory and CS

Key Identities (any base b)

logᵦ(1) = 0 (b⁰ = 1)

logᵦ(b) = 1 (b¹ = b)

logᵦ(M·N) = logᵦ(M) + logᵦ(N) (product rule)

logᵦ(M/N) = logᵦ(M) − logᵦ(N) (quotient rule)

logᵦ(Mⁿ) = n · logᵦ(M) (power rule)

b^logᵦ(x) = x (inverse cancellation)

How to Use

  1. 1
    Select a mode: Choose Evaluate logᵦ(x), Find Base, Find Argument, or Change of Base depending on what you want to compute.
  2. 2
    Select the base: Click log₁₀, ln (base e), log₂, or Custom. For Custom, type the base value in the field that appears.
  3. 3
    Enter the argument x: Type the positive number you want the logarithm of. For Find Base mode, this is the result of the log; for Find Argument, x is solved for you.
  4. 4
    Enter y if needed: For Find Base and Find Argument modes, enter the logarithm value y (the result of the log operation).
  5. 5
    Press Enter or click Calculate: The result appears with full precision (8 decimal places), plus related values in other bases and a step-by-step breakdown.
  6. 6
    Expand Step-by-step: Click the collapsible panel to see how the change-of-base formula was applied and a numerical verification.
  7. 7
    Try a preset: Click any of the six preset buttons (log₂(8), log₁₀(1000), ln(e), etc.) to instantly load a worked example.

Example Calculation

Evaluate log₅(125) using the change of base formula

Given: logᵦ(x) where b = 5, x = 125

Step 1: Apply change of base

log₅(125) = ln(125) / ln(5)

Step 2: Compute natural logs

ln(125) = 4.828314

ln(5) = 1.609438

Step 3: Divide

4.828314 / 1.609438 = 3.000000

log₅(125) = 3 (since 5³ = 125)

xlog₁₀(x)ln(x)log₂(x)log₅(x)
10000
50.69901.60942.32191
251.39793.21894.64392
125 ★2.09694.82836.96573
6252.79596.43789.28774

Verification

5³ = 5 × 5 × 5 = 125. So log₅(125) = 3 exactly. The change-of-base calculation confirms this numerically to 8 decimal places.

Understanding Logarithm | Log & Ln

A Brief History of Logarithms

Logarithms were invented by the Scottish mathematician John Napier in 1614, published in Mirifici Logarithmorum Canonis Descriptio. His goal was purely practical: simplify the laborious multiplication and division required by astronomers, navigators, and scientists. Before electronic calculators, log tables were the computational backbone of science and engineering for over 350 years.

The key insight: multiplication of large numbers becomes addition of their logarithms. log(a × b) = log(a) + log(b). This transformed a multiplication (slow) into a table lookup plus an addition (fast).

The Natural Logarithm and Euler's Number

The natural logarithm ln(x) is unique because it is the logarithm whose derivative is simply 1/x. This means d/dx[ln(x)] = 1/x and ∫ (1/x) dx = ln(x) + C. No other base produces such a clean result, which is why ln appears so often in calculus, differential equations, and mathematical analysis.

Euler's number e ≈ 2.71828 is defined precisely as the value where this simplicity holds. It appears in:

  • Compound interest: A = Pe^(rt), continuous compounding
  • Radioactive decay: N(t) = N₀ · e^(−λt)
  • Population growth: P(t) = P₀ · e^(kt)
  • Normal distribution: the bell curve contains e^(−x²/2)
  • Euler's identity: e^(iπ) + 1 = 0, often called the most beautiful equation in mathematics

Logarithmic Scales in Science and Engineering

Many physical quantities span many orders of magnitude. Logarithmic scales compress these into human-readable numbers:

ScaleFormulaWhy Logarithmic?
pH (acidity)pH = −log₁₀[H⁺]H⁺ concentration spans 10 orders of magnitude
Decibels (sound)dB = 10 log₁₀(I/I₀)Human hearing spans 10¹² in intensity
Richter scaleM = log₁₀(A/A₀)Earthquake energy spans enormous ranges
Stellar magnitudem = −2.5 log₁₀(F/F₀)Star brightness spans billions to one
Bits of informationH = −Σ pᵢ log₂(pᵢ)Shannon entropy uses log₂ for information theory

The Change of Base Formula, Why It Works

Every calculator and programming language natively provides only ln (or log₁₀). To compute logᵦ(x) for an arbitrary base b, the change-of-base formula is:

logᵦ(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b)

This works because if logᵦ(x) = y, then b^y = x. Taking ln of both sides: y · ln(b) = ln(x), so y = ln(x) / ln(b). The denominator ln(b) is a scaling constant for any fixed base b.

Logarithms and exponents are inverses

logᵦ(b^x) = x and b^(logᵦ(x)) = x. These two identities are the fundamental inverse relationship. If you raise b to the power logᵦ(x), you always get back x. This is why logarithms "undo" exponentials, just as square roots undo squaring.

Frequently Asked Questions

What is a logarithm?

A logarithm answers: "To what power must b be raised to get x?" Formally, logᵦ(x) = y means b^y = x.

  • log₁₀(1000) = 3 because 10³ = 1000
  • ln(e²) = 2 because e² = e²
  • log₂(8) = 3 because 2³ = 8
  • logᵦ(1) = 0 for any valid base b (b⁰ = 1 always)

Logarithms are the inverse of exponentials. Just as subtraction undoes addition and division undoes multiplication, logarithms undo exponentiation.

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

All three are logarithms, they differ only in their base:

  • log (without a subscript) usually means log₁₀, the common logarithm, base 10.
  • ln means the natural logarithm, base e ≈ 2.71828 (Euler's number).
  • log₂ means the binary logarithm, base 2, used in information theory and computer science.

They are all related through the change-of-base formula: logᵦ(x) = ln(x) / ln(b). This calculator shows all three simultaneously for every evaluation.

Why is ln (natural log) preferred in mathematics and calculus?

The natural logarithm has a unique calculus property that makes it the "natural" choice:

  • d/dx [ln(x)] = 1/x, the simplest possible derivative
  • ∫ (1/x) dx = ln|x| + C, the antiderivative of 1/x
  • The exponential function e^x is its own derivative: d/dx [e^x] = e^x

No other base produces such clean derivatives. For log₁₀(x), the derivative is 1/(x · ln 10), which introduces an extra constant. This is why higher mathematics almost exclusively uses ln.

Can I take the logarithm of a negative number or zero?

No, in real number arithmetic, logarithms are only defined for strictly positive arguments (x > 0).

  • log(0) is undefined, it would require b^y = 0, which has no finite solution
  • log(negative) is undefined in the reals, no real power of a positive base gives a negative result
  • Complex logarithms do exist: ln(−1) = iπ (Euler's formula), but these require complex number theory

The base b must also satisfy b > 0 and b ≠ 1.

What is the change of base formula and when do I use it?

The change of base formula is: logᵦ(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b).

Use it when:

  • Your calculator only has ln or log₁₀ and you need a different base
  • You want to compare values in different bases
  • Programming, most languages only expose Math.log() (natural log) or Math.log10()

Example: log₃(50) = ln(50) / ln(3) = 3.912 / 1.099 = 3.561.

How do I find the base when given logᵦ(x) = y?

Use the Find Base mode. If logᵦ(x) = y, then by definition b^y = x. Solving for b:

b = x^(1/y)

Example: logᵦ(100) = 2 → b = 100^(1/2) = 10. So log₁₀(100) = 2, confirmed.

This mode is useful when you know the argument and result but need to identify the base being used.

What are some real-world examples of logarithms?

  • pH chemistry: pH = −log₁₀[H⁺]. Neutral water has pH 7 (H⁺ = 10⁻⁷ mol/L).
  • Sound: decibels dB = 10 log₁₀(I/I₀). A whisper is ~30 dB; a rock concert ~110 dB.
  • Earthquakes: each Richter magnitude step is 10× more energy.
  • Finance: continuous compound interest A = Pe^(rt) involves the natural logarithm.
  • Computer science: binary search runs in O(log₂ n) time, log₂(1,000,000) ≈ 20 steps.

Does the calculator save my inputs between sessions?

Yes, inputs are automatically saved to your browser's localStorage:

  • Mode, base selection, and all input values are persisted after each calculation
  • Data is restored the next time you open the page
  • All computation happens in your browser, nothing is sent to any server

Click Reset to clear the form and remove the saved data.

Related Calculators