Logarithms Explained: Bases, ln, Change of Base and Real Uses

What log_b(x) means, the three log laws, the change-of-base formula, when a log is an exact fraction, and logarithmic scales from pH to decibels to bits.

· 9 min read

Illustration for the Logarithm Calculator guide

A logarithm is an exponent looked at from the other side. Ask "2 to what power is 1024?" and the answer, 10, is log₂ 1024. That one idea explains the notation, the rules and why logarithms keep turning up in chemistry, acoustics, computing and finance. This article covers what a logarithm is, the three laws, the change-of-base formula, when a logarithm comes out as an exact fraction, and the logarithmic scales you meet in everyday measurements. The Logarithm Calculator will check any of the examples.

What log_b(x) means

log_b(x) = y   means exactly the same as   bʸ = x

The base b must be positive and not 1, and x must be positive. Some quick values:

ExpressionBecauseValue
log₁₀ 100010³ = 10003
log₂ 10242¹⁰ = 102410
log₁₀ 0.00110⁻³ = 0.001−3
log₅ 15⁰ = 10
log₈ 328^(5/3) = 325/3
ln e²e² = e²2

Three bases have their own names. The common logarithm, log₁₀, is often written just log on calculators and in science. The natural logarithm, ln, has base e ≈ 2.718281828, the base that makes calculus tidiest because the slope of ln x is exactly 1/x. The binary logarithm, log₂, counts doublings and is everywhere in computing. A warning about notation: in pure mathematics and in most programming languages, log with no base means the natural log, not log₁₀. Python's math.log(100) is 4.605…, not 2.

Why x must be positive

A positive base raised to any real power gives a positive result. There is no real y with 10ʸ = 0 or 10ʸ = −5, so log₁₀ 0 and log₁₀(−5) are undefined over the real numbers. As x shrinks toward zero, log x falls without limit toward minus infinity, which you can see in the graph below. The base cannot be 1 because 1 to every power is 1, so log₁ 5 would have no answer and log₁ 1 would have every answer.

Graph of y equals log base 2 of x, log base e of x and log base 10 of x, all crossing the x axis at x equals 1, rising slowly to the right and falling toward minus infinity as x approaches 0
Graph of y equals log base 2 of x, log base e of x and log base 10 of x, all crossing the x axis at x equals 1, rising slowly to the right and falling toward minus infinity as x approaches 0

All logarithm curves pass through (1, 0) and (b, 1). Bigger bases give flatter curves, because it takes a smaller exponent of a big base to reach a given number.

The three laws

Because logarithms are exponents, the exponent rules translate directly:

log_b(xy)  = log_b x + log_b y          (product rule)
log_b(x/y) = log_b x − log_b y          (quotient rule)
log_b(xⁿ)  = n · log_b x                (power rule)

The product rule is the reason logarithms were invented. John Napier published the first tables in 1614 and Henry Briggs produced base-10 tables soon after, because adding two numbers from a table is far easier than multiplying two eight-digit numbers by hand. The slide rule, which engineers carried until pocket calculators arrived in the 1970s, is the product rule made physical: two logarithmic scales slide against each other so that adding lengths multiplies numbers.

Common mistakes come from inventing rules that do not exist. log(x + y) is not log x + log y, and (log x)² is not 2 log x. Only products, quotients and powers inside the log simplify.

Change of base

Calculators usually have ln and log₁₀ buttons and nothing else. To get any other base, divide:

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

The proof takes one line: if y = log_b x then bʸ = x, so taking natural logs of both sides gives y ln b = ln x, and y = ln x / ln b. For example, log₅ 100 = ln 100 / ln 5 = 4.605170 / 1.609438 = 2.861353. Two useful special cases are ln x = 2.302585… × log₁₀ x and log₂ x = 3.321928… × log₁₀ x.

The Logarithm Calculator accepts any base directly, works to 80 significant digits and shows 30, and prints the change-of-base working so you can follow it on paper.

When is a logarithm exact?

Most logarithms are irrational. log₁₀ 2 = 0.301029995663981195213738894724… never ends or repeats, and you can prove it: if log₁₀ 2 were p/q then 10ᵖ = 2^q, but 10ᵖ has a factor of 5 and 2^q does not.

The same reasoning tells you when a logarithm is a fraction. log_b x = p/q exactly when x^q = bᵖ. For log₈ 32, both numbers are powers of 2: 8 = 2³ and 32 = 2⁵, so 32³ = 2¹⁵ = 8⁵ and log₈ 32 = 5/3. Similarly log₄ 8 = 3/2 and log₂₇ 9 = 2/3. The calculator looks for such fractions by taking the high-precision decimal, finding the nearby fractions with small denominators by continued fractions, and confirming the winner with exact whole-number arithmetic. That last step matters: a decimal that looks like 1.6666666666 might not be 5/3, and only the integer check proves it.

Characteristic and mantissa

Before calculators, people looked up common logarithms in printed tables, and the tables listed only the fractional part. The reason is neat. log₁₀ 3.7 = 0.5682, log₁₀ 37 = 1.5682 and log₁₀ 3700 = 3.5682. Moving the decimal point only changes the integer part, called the characteristic, while the fractional part, the mantissa, depends only on the digits. One table of mantissas for 1.000 to 9.999 covered every number.

The characteristic still has a modern use: for x ≥ 1, the number of digits before the decimal point is the characteristic plus 1. log₁₀ 1024 = 3.0103, so 1024 has 4 digits. The same trick tells you that 2^1000 has floor(301.03) + 1 = 302 digits without computing it.

Logarithmic scales you already use

When a quantity ranges over many powers of ten, a logarithmic scale squeezes it into manageable numbers. Each step on the scale is a constant ratio, not a constant difference.

Three logarithmic scales side by side: pH from 0 to 14 where each unit is a tenfold change in hydrogen ion activity, decibels where each 10 dB is a tenfold change in power, and binary bits where each extra bit doubles the count of values
Three logarithmic scales side by side: pH from 0 to 14 where each unit is a tenfold change in hydrogen ion activity, decibels where each 10 dB is a tenfold change in power, and binary bits where each extra bit doubles the count of values
ScaleDefinitionOne step means
pH−log₁₀ of hydrogen-ion activity10 times more or less acidic
Decibels (power)10 log₁₀(P / P₀)+10 dB = 10 times the power; +3 dB ≈ double
Decibels (amplitude)20 log₁₀(V / V₀)+20 dB = 10 times the voltage or pressure
Earthquake magnitudelog₁₀ of wave amplitude, roughly10 times the amplitude, about 32 times the energy
Bitslog₂ of the number of valuesTwice as many values
Musical octavelog₂ of frequency ratioDouble the frequency

Going the other way is the antilog. If blood has a pH of 7.4, its hydrogen-ion activity is 10^−7.4 ≈ 3.98 × 10⁻⁸ mol/L. A pKa of 4.76 for acetic acid means Ka = 10^−4.76 ≈ 1.74 × 10⁻⁵. The Logarithm Calculator's antilog mode does this directly, and the pH Calculator and Decibel Calculator wrap the same arithmetic in their own units.

Logarithms in computing

Binary search halves the remaining range at each step, so finding one item among a million takes at most ceil(log₂ 1,000,000) = 20 comparisons. A number up to N needs floor(log₂ N) + 1 bits; log₂ 1000 = 9.97, so 1000 needs 10 bits. Information theory measures information in bits for the same reason: an event with probability p carries −log₂ p bits.

Logarithms in growth and decay

To find how long something takes to grow by a factor, solve bᵗ = factor for t, which is t = log(factor) / log(b). Money at 5% doubles in ln 2 / ln 1.05 = 14.2 years. A radioactive sample with a half-life of 5730 years (carbon-14) falls to 10% of its original amount after 5730 × log₂ 10 = 5730 × 3.3219 ≈ 19,035 years. The Half-Life Calculator uses exactly this.

Solving for the base

Sometimes you know the log and the number but not the base: log_b 81 = 4. Rewrite as b⁴ = 81 and take the fourth root: b = 81^(1/4) = 3. The base is always positive, so although (−3)⁴ = 81 too, −3 is not a valid base. The calculator's base mode does this and returns an exact answer whenever the root is exact, such as log_b 2 = 0.5 giving b = 4.

Summary

  • log_b x is the exponent y with bʸ = x; x > 0, b > 0, b ≠ 1.
  • Products become sums, quotients become differences, powers become multipliers.
  • Change base with log_b x = ln x / ln b.
  • A log is a fraction p/q exactly when x^q = bᵖ.
  • Logarithmic scales count ratios: pH, decibels, magnitudes, bits and octaves.

Work through your own numbers in the Logarithm Calculator, and use the Exponent Calculator for the inverse direction.

Sources

  • John Napier, Mirifici Logarithmorum Canonis Descriptio (1614); Henry Briggs, Arithmetica Logarithmica (1624).
  • IUPAC, Compendium of Chemical Terminology (Gold Book), entry on pH.
  • NIST Digital Library of Mathematical Functions, chapter 4, elementary functions (logarithms and change of base).
  • USGS Earthquake Hazards Program, magnitude and energy: each whole-number step is about 32 times more energy.

Related searches

  • what is a logarithm
  • change of base formula
  • natural log vs common log
  • log rules product quotient power
  • how to find antilog
  • logarithmic scale examples
  • log base 2 bits
  • characteristic and mantissa

Open the Logarithm Calculator