Log vs ln: which logarithm should you use
Last reviewed on 30 April 2026.
Two logarithm keys sit next to each other on the SCI panel: log and ln. They look almost identical and they almost mean the same thing, which is exactly why people pick the wrong one. This page explains what each key computes, when each is the natural choice, and how to convert from one base to another in a single step.
What a logarithm answers
A logarithm answers a question about an exponent: "what power do I raise the base to in order to get this number?". log₁₀(1000) equals 3 because 10³ is 1000. log₂(8) equals 3 because 2³ is 8. The same idea works for any positive base other than 1.
If exponentiation undoes a logarithm, a logarithm undoes exponentiation. They are inverse operations, and most of the work you do with logarithms is some flavour of "solve for the exponent".
What the two keys compute
logon this calculator means base 10.log(1000)returns 3. Most engineering, finance, and chemistry references that say "log" without qualification mean base 10.lnmeans natural logarithm — base e, where e is roughly 2.71828.ln(e)returns 1 andln(1)returns 0. Mathematics and physics references that say "log" usually mean ln, especially in calculus.
If your textbook simply writes "log" with no base, look at the context. Calculus and pure mathematics: ln. Chemistry, decibels, magnitude scales: base 10. Computer science: base 2 is common, written log₂ or lg.
When base 10 is the natural choice
Base-10 logarithms shine when the underlying scale is decimal. A few cases where you almost always want log:
- pH. The pH of a solution is
−log₁₀of the hydrogen ion activity. A pH of 4 means an activity of 10⁻⁴ moles per litre. - Decibels. Sound intensity in decibels is
10 × log₁₀(I / I₀). A 10 dB jump means ten times the intensity. - Earthquake magnitude. Each whole-number step on the moment magnitude scale corresponds to about 10 times the ground motion and roughly 31.6 times the energy.
- Counting digits. The number of digits in a positive integer N is
floor(log₁₀(N)) + 1.
When natural log is the natural choice
Natural logarithms come up wherever continuous growth or continuous decay is involved, because the exponential function e^x has the special property that its rate of change is itself.
- Compound interest, continuous case. Money growing at rate r compounded continuously turns into
P × e^(rt)after t years. To solve for time given a final amount, take ln of both sides. - Half-life and decay. A quantity that decays exponentially follows
N(t) = N₀ × e^(−kt). The half-life isln(2) / k, roughly 0.693 over the decay constant. - Calculus. The derivative of
ln(x)is1/x. The derivative oflog₁₀(x)is1 / (x × ln(10))— clean only with the natural log. - Information theory. Entropy is often expressed in nats, the unit you get when you use natural log instead of base 2. The factor between the two is
ln(2).
The change-of-base formula
If you only have log and ln on the calculator but you need a logarithm in some other base — say base 2 or base 7 — use the change-of-base identity:
log_b(x) = log(x) / log(b)
log_b(x) = ln(x) / ln(b)
Both forms are correct; pick whichever key is closer. To compute log₂(64), type log(64) / log(2) and the calculator returns 6. To compute log₇(343), type ln(343) / ln(7) and you get 3. The same trick lets you reproduce one logarithm key from the other: log(x) = ln(x) / ln(10).
Worked example: continuously compounded interest
Suppose a deposit of 1,000 grows to 1,500 at a continuously compounded interest rate. How long does that take if the rate is 4% per year? The model is 1500 = 1000 × e^(0.04 × t). Divide both sides by 1,000, then take ln:
ln(1.5) = 0.04 × t
t = ln(1.5) / 0.04
Type ln(1.5) / 0.04 into the calculator and the result is about 10.13 years. Trying to solve the same problem with log works only if you also divide by log(e), which is roughly 0.4343 — easy to forget. This is the kind of problem where ln is unambiguously the right key.
Worked example: pH
A solution has a hydrogen ion activity of 4 × 10⁻⁹ mol/L. The pH is −log(4 × 10⁻⁹). Type -log(4 * 10^-9) and you get about 8.40. Using ln instead would give the wrong magnitude entirely, because the chemistry definition is locked to base 10.
Worked example: digits in a big number
How many digits does 2¹⁰⁰ have? Type log(2^100) and you get about 30.103. The integer part plus one is the digit count: 31 digits. The same calculation with ln would give a different number that needs a conversion factor, so log is the cleaner choice here.
Common mistakes
- Mixing up the keys mid-problem. If a textbook formula looks like
−log(...)for pH or decibels, never substitute ln. They differ by a factor of about 2.303. - Trying to take the log of zero or a negative number. Both keys return an error or a non-real value. If your problem is heading there, double-check the model — most physical quantities passed to a logarithm should be strictly positive.
- Forgetting parentheses.
log10xlooks fine on paper but on the calculator you must typelog(10*x)orlog(10) * x, depending on what you mean. The keys insertlog(orln(for you, which helps. - Reading "log" as ln in physics class. Some calculus and physics books write log when they mean ln. If a derivative comes out cleaner with the natural log, the textbook almost certainly meant ln.
Decision checklist
- Is the formula about continuous growth, decay, or calculus? Use
ln. - Is the formula about pH, decibels, magnitudes, or digit counting? Use
log. - Do you need a different base entirely? Apply the change-of-base formula.
- Is the input non-positive? Stop and re-check the problem.