When to Use ln vs log Depends on Your Field

The short answer: use ln when working with continuous growth, calculus, or formulas built around the number e (roughly 2.718). Use log when working with orders of magnitude, pH, decibels, or anything scaled by powers of 10. In computer science, the implied base is often 2. The choice depends entirely on the context you’re working in and which base makes the math cleanest.

The confusion is understandable because “log” means different things in different fields. In pure math and most scientific writing, log with no base written usually means base 10. On a calculator, the LOG button is base 10 and the LN button is base e. But in many university math courses and most programming languages, “log” actually refers to the natural log (base e). Knowing the conventions of your field clears up most of the ambiguity.

What Each One Actually Means

A logarithm answers one question: “What exponent do I need?” If you write log₁₀(1000) = 3, you’re saying 10 raised to the 3rd power equals 1000. If you write ln(100) = 4.605, you’re saying e raised to the 4.605 power equals 100. The only difference between ln and log is the base: ln uses e (approximately 2.718281828), while log typically uses 10.

You can always convert between them. Dividing a natural log by 2.303 gives you the base-10 log of the same number. For example, ln(100) = 4.60517, and dividing that by 2.303 gives you 2, which is log₁₀(100). This conversion factor (2.303) shows up constantly in chemistry and physics when formulas switch between the two notations.

When To Use ln (Natural Log)

The natural log dominates anywhere continuous change is involved. That’s because e isn’t an arbitrary choice. It’s the one base where the rate of growth of an exponential function equals the function’s current value, which makes it the natural language for describing processes that grow or decay smoothly over time.

In calculus, this advantage is impossible to ignore. The derivative of ln(x) is simply 1/x. Clean and elegant. The derivative of log₁₀(x), by contrast, is 1/(x · ln 10), which drags along an extra constant. Every calculus operation involving logarithms becomes simpler with ln, which is why it’s the default in any course past algebra. Logarithmic differentiation, a technique used to break apart complicated products and powers before taking derivatives, always starts by taking the natural log of both sides.

In finance, ln is the basis for continuously compounded returns. The logarithmic return on an investment is calculated as ln(P_today / P_yesterday), giving you the continuously compounded rate of change. The famous Rule of 72, which estimates how long it takes an investment to double, comes directly from the equation ln(2) = r · t, where r is the interest rate and t is time. Since ln(2) is about 0.693, doubling time equals 0.693 divided by the rate. The number 72 is used instead of 69.3 because it’s easier to divide mentally and gives a slightly better approximation at typical annual interest rates.

Physics and chemistry use ln in their core equations. The Nernst equation for electrochemical cell voltage is naturally written with ln. The Arrhenius equation for reaction rates uses ln. Radioactive decay, population growth, cooling curves: all use e as their base, so ln is the matching logarithm.

When To Use log (Base 10)

Base-10 logarithms shine when you’re measuring things that span huge ranges and you want to compress them into manageable numbers. The pH scale is a base-10 log: a pH of 3 means the hydrogen ion concentration is 10⁻³ moles per liter. Each whole number step represents a tenfold change. The Richter scale for earthquakes, the decibel scale for sound intensity, and stellar magnitude in astronomy all work the same way.

In chemistry, you’ll often see the same equation written both ways. The Nernst equation in its natural form uses ln, but textbooks frequently convert it to log₁₀ by multiplying through by 2.303. At room temperature, this simplifies the equation to a neat constant of 0.0592 V divided by the number of electrons transferred. The ln version is more fundamental, but the log₁₀ version is more practical for quick calculations, which is why both appear in coursework.

Engineering fields that deal with signal strength, power ratios, or frequency response typically use base-10 logs because their scales (decibels, Bels) are built on powers of 10.

The Special Case of Base 2 in Computer Science

In algorithm analysis and computer science, the relevant base is almost always 2. Binary search cuts a problem in half at each step, so searching through n items takes roughly log₂(n) steps. Sorting algorithms, tree structures, and anything involving repeated halving or doubling naturally produce base-2 logarithms.

Here’s the practical twist: when computer scientists write O(log n) to describe how an algorithm’s running time scales, the base doesn’t matter. Logarithms of different bases differ only by a constant factor, and big-O notation ignores constant factors. So O(log₂ n), O(log₁₀ n), and O(ln n) all describe the same growth rate.

There is one important exception. When a logarithm appears in an exponent, the base matters enormously. O(2^(log₂ n)) simplifies to O(n), but O(2^(ln n)) equals roughly O(n^0.693), a completely different growth rate.

What “log” Means Depends on Your Field

This is the single biggest source of confusion. The convention for an unwritten base varies:

  • Mathematics (pre-calculus, applied sciences): log means log₁₀
  • Pure mathematics and most university-level courses: log often means ln (base e)
  • Computer science: log usually means log₂
  • Most calculators: LOG is base 10, LN is base e
  • Programming languages (Python, R, many others): log() computes the natural log by default

The international standard ISO 80000-2 actually recommends distinct symbols: ln for base e, lg for base 10, and lb for base 2. In practice, almost nobody outside of certain European textbooks uses lg or lb. You’ll need to rely on context.

A Quick Decision Rule

If you’re doing calculus, differential equations, or working with any formula involving e, use ln. If you’re measuring something on a scale based on powers of 10 (pH, decibels, Richter), use log₁₀. If you’re analyzing algorithms or binary data structures, think in terms of log₂. And if a formula in a textbook just writes “log” with no base, check the field’s convention before assuming.

When in doubt, ln is the safer default for any serious mathematical work. It keeps derivatives clean, integrates naturally into exponential models, and converts to any other base with a single division. Base-10 and base-2 logs exist for convenience in specific applied contexts, but ln is the one that falls out of the math itself.