Mathematics

Common Logarithm vs. Natural Logarithm

Compare base-10 log and base-e ln, their inverse exponential relationships, domains, change of base, and NumUtility syntax. This guide explains the reasoning, not just the keystrokes.

Published · Updated · 6 min read

Two logarithm bases

A logarithm answers an exponent question. The statement log_b(x)=y means b^y=x, where b is positive, b is not 1, and x is positive in the real-number setting. A common logarithm has base 10 and is often written log(x). A natural logarithm has base e and is written ln(x), where e is approximately 2.71828.

NumUtility follows those meanings exactly: log(x) calls the base-10 logarithm, and ln(x) calls the natural logarithm. It does not treat log as base e and does not offer log2 or a two-argument arbitrary-base function. Because notation varies across subjects and software, identify the base rather than assuming every use of log means the same thing.

Inverse relationships

Logarithms undo exponentials with the same base. If y=log(x), then 10^y=x; if y=ln(x), then e^y=x. Consequently log(1000)=3 because 10³=1000, and ln(e²)=2. The reverse identities are 10^log(x)=x and e^ln(x)=x for positive real x.

The calculator provides ^, e, log, and ln, so these relationships can verify results numerically. Floating-point rounding may keep the reverse result from matching every final digit for an arbitrary input. The inverse relationship is mathematical; the displayed decimal is a finite numerical approximation. Preserve enough significant digits when performing a round trip.

Domain and special values

For real logarithms, the input must be greater than zero. No real exponent makes a positive base equal zero or a negative number. Therefore log(0), ln(0), log(-1), and ln(-4) are outside the implemented real domain and produce a generic invalid-expression error. Complex logarithms exist but are not supported.

Every valid logarithm base gives log_b(1)=0 because b^0=1. Inputs between zero and one have negative logarithms: log(0.01)=-2 because 10^-2=0.01. Inputs greater than one have positive logarithms for bases greater than one. These sign checks help detect a mistyped reciprocal or missing decimal point.

Three verified examples

Input: log(1000). Rule: NumUtility log uses base 10. Steps: find the exponent y satisfying 10^y=1000. Result: 3. Verification: 10^3=1000.

Input: ln(e^2). Rule: ln and the base-e exponential are inverses. Steps: evaluate e², then take its natural logarithm. Result: 2. Verification: e^2 recreates the original positive argument.

Input: log(0.01). Rule: express the positive input as a power of ten. Steps: 0.01=1/100=10^-2. Result: -2. Verification: 10^-2=0.01. The negative output is valid because the input remains positive.

Change of base

Any valid logarithm can be computed from another base using log_b(x)=ln(x)/ln(b). The same quotient can use common logs: log_b(x)=log(x)/log(b). The numerator and denominator must use the same logarithm function. For example, log_2(8)=ln(8)/ln(2)=3.

NumUtility has no log2 function or two-argument log syntax, so enter ln(8)/ln(2) with explicit parentheses if needed. The base must be positive and not equal to one, and x must be positive. A base of one would make the denominator ln(1)=0 and cannot define a one-to-one exponential inverse. A negative base requires more specialized complex or restricted-integer analysis outside this tool.

Why ln appears naturally

The constant e is the base whose exponential has especially simple calculus properties, making ln central to continuous growth, decay, and calculus. Base 10 is convenient for decimal orders of magnitude. Choosing a base changes the numerical logarithm by a constant factor but does not change the underlying input ordering for bases greater than one.

Applications in chemistry, acoustics, finance, engineering, and data analysis can use logarithms, but a bare calculator value is not a professional conclusion. Those fields add definitions, units, calibration, uncertainty, and domain-specific assumptions. This guide uses only mathematical examples and does not advise on pH, exposure, investment, or engineering decisions.

Syntax and precedence

Write log(argument) or ln(argument) with parentheses. The argument may be an expression, such as log(10^3) or ln(e^2). Exponentiation inside the function argument is completed before the function returns its value. Multiplication must remain explicit: ln(2*x) would be valid only if x were a supported variable, but variables are not implemented, so substitute a numeric value.

The constant e can be followed by an exponent using e^2. Scientific notation such as 1e3 is parsed as the number 1000, whereas e by itself is the constant. The parser lowercases names, but an unknown function fails. It rejects nonfinite logarithm results, which is why log(0) does not display negative Infinity. Consult the order guide for grouping in longer quotients.

Numerical accuracy and checks

JavaScript Math.log and Math.log10 use binary floating-point arithmetic. Familiar exact examples generally format cleanly, while arbitrary inputs produce rounded results. The interface shows at most twelve significant digits. Check a logarithm by raising its base to the displayed result, allowing for rounding rather than demanding character-for-character equality.

Choose log when the mathematical base is 10 and ln when it is e. Use change of base when another positive base is stated. Confirm the argument is positive before calculating and keep units or contextual meaning outside the expression. The calculator does not provide symbolic simplification, complex logarithms, arbitrary precision, or domain-specific validation. A correct numeric logarithm can still be misapplied if the original model is wrong.

Logarithm laws and their conditions

For positive x and y, log_b(xy)=log_b(x)+log_b(y), log_b(x/y)=log_b(x)-log_b(y), and log_b(x^r)=r log_b(x) when the real expressions are defined. The same laws hold for log and ln because they differ only in base. They explain why multiplication becomes addition on a logarithmic scale, but they do not permit splitting a sum: log(x+y) is generally not log(x)+log(y).

Input: ln(e^3/e). Rule: use exponent laws or the logarithm quotient law. Steps: e^3/e=e^2, then ln(e²)=2. Result: 2. Verification: e² is positive and exponentiating the result with base e returns e². This example stays within the implemented syntax and real domain.

Parentheses control the logarithm's full argument. Write log((100*10)) or simply log(1000), not log(100)*10 when the product belongs inside the logarithm. Before applying any identity, confirm each logarithm argument is positive; algebraic cancellation can hide a forbidden intermediate expression. NumUtility evaluates the entered numeric form and does not prove symbolic domain equivalence.

Changing the base changes scale, not the underlying positive input. Since ln(x)=ln(10)×log(x), natural-log values are about 2.302585 times the corresponding common-log values. The ratio is constant for every positive x other than 1, where both logs are zero. This provides a magnitude check: ln(1000) should be about 6.9078 while log(1000)=3. A result that treats them as identical likely used the wrong function or an unstated convention. Always copy the function name with the reported value so another reader knows which logarithmic scale produced it.

Frequently asked questions

What base does log use in NumUtility?

log(x) uses base 10.

What base does ln use?

ln(x) uses the constant e as its base.

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

Not in this real-number calculator. The input must be greater than zero.

How do I calculate a logarithm in another base?

Use change of base, such as ln(x)/ln(b), with a positive base b not equal to 1.

Why is log(1) equal to zero?

Any valid logarithm base raised to the zero power equals 1.

Sources

References used to support definitions and interpretation in this guide.

  1. OpenStax Precalculus — Logarithmic Functions
  2. MDN — JavaScript Math
  3. NIST DLMF §4.45 — Logarithm computation