Skip to main content
ilovecalcs logoilovecalcs.

Math · Live

Log Calculator, ln, log₁₀, log₂, any base.

Calculate the natural logarithm (ln), common log (log₁₀), binary log (log₂), and any arbitrary-base logarithm simultaneously from a single input. Includes a step-by-step change-of-base derivation, interactive curve chart, and a logarithm identities reference.

How it works4 bases at once

Inputs

Logarithm

Computing

log_10(8) = 0.90308999

Quick values

ln(x)
2.0794415
log₁₀(x)
0.90308999
log₂(x)
3

Logarithms of 8

x = 8

Natural log

ln(8)

2.0794415

base e ≈ 2.71828

Common log

log₁₀(8)

0.90308999

base 10

Binary log

log₂(8)

3

base 2

Custom base

logᵦ(x)

← set base b

switch mode to 'b'

Math notepad

Step-by-step using the change-of-base identity.

handworked

Natural logarithm (base e ≈ 2.71828...):

ln(8) = 2.0794415

Common logarithm (base 10):

log₁₀(8) = ln(8) / ln(10)

= 2.0794415 / 2.3025851

= 0.90308999

Binary logarithm (base 2) via change-of-base:

log₂(8) = ln(8) / ln(2)

= 2.0794415 / 0.69314718

= 3

Logarithm curves

y = log(x) for three common bases

lnlog₁₀log₂

Reference

Logarithm identities

Product rulelog_b(x·y) = log_b(x) + log_b(y)
Quotient rulelog_b(x/y) = log_b(x) − log_b(y)
Power rulelog_b(xⁿ) = n · log_b(x)
Change of baselog_b(x) = ln(x) / ln(b)
Reciprocallog_b(1/x) = −log_b(x)
log of 1log_b(1) = 0 (for any b)
log of baselog_b(b) = 1 (for any b)

Logarithm guide

What is a logarithm and how do you calculate one?

A logarithm answers the question: to what power must a given base be raised to produce a given number? If b^y = x, then by definition log_b(x) = y. Logarithms are the inverse operation of exponentiation, just as subtraction undoes addition, the logarithm undoes raising to a power.

The formal definition

log_b(x) = y ⟺ b^y = x (where b > 0, b ≠ 1, and x > 0)

For example, log₁₀(1000) = 3 because 10³ = 1000; log₂(8) = 3 because 2³ = 8; and ln(e) = 1 because e¹ = e.

Natural logarithm: ln(x)

The natural logarithm uses Euler's number e ≈ 2.71828 as its base. It appears throughout calculus, physics, finance, and statistics because the derivative of ln(x) is simply 1/x — cleaner than any other logarithmic base:

d/dx [ln(x)] = 1/x

Natural log underpins compound growth models, probability distributions (including the normal distribution's Z-score), and information theory. When mathematicians write "log" without a subscript, they often mean ln.

Common logarithm — log₁₀(x)

The common logarithm (base 10) was the workhorse of pre-computer arithmetic (tables of log₁₀ values let engineers and scientists multiply large numbers by adding their logs. It remains useful wherever the decimal system is natural:

  • The pH scale: pH = −log₁₀([H⁺])
  • The Richter earthquake scale: magnitude = log₁₀(amplitude)
  • Decibels: dB = 10 × log₁₀(P₂/P₁)
  • The magnitude of a star in astronomy

The number of decimal digits in a positive integer n equals ⌊log₁₀(n)⌋ + 1, a handy shortcut in programming.

Binary logarithm) log₂(x)

The binary logarithm is the natural unit for information theory and computer science, as defined by Claude Shannon in 1948. One bit of information equals log₂(2) = 1. Key uses:

  • Big-O complexity: A binary search over n items takes O(log₂ n) comparisons.
  • Data compression: The optimal number of bits to encode an event with probability p is −log₂(p) bits.
  • Number of bits: ⌊log₂(n)⌋ + 1 is the number of bits needed to represent the integer n in binary.

The change-of-base formula

Any logarithm can be expressed in terms of any other base using the change-of-base identity. This is how the calculator computes arbitrary-base logarithms from the built-inMath.log (which computes ln):

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

For example, log₅(125) = ln(125) / ln(5) = 4.8283 / 1.6094 = 3. You can verify: 5³ = 125 ✓.

Essential logarithm properties

These six identities let you simplify virtually any logarithmic expression:

RuleFormulaExample
Productlog_b(xy) = log_b(x) + log_b(y)log₂(4·8) = log₂(4) + log₂(8) = 2 + 3 = 5
Quotientlog_b(x/y) = log_b(x) − log_b(y)log₁₀(100/10) = 2 − 1 = 1
Powerlog_b(xⁿ) = n · log_b(x)ln(e⁵) = 5 · ln(e) = 5
Rootlog_b(ⁿ√x) = log_b(x) / nlog₁₀(√100) = log₁₀(100) / 2 = 1
log of 1log_b(1) = 0ln(1) = 0, log₂(1) = 0
log of baselog_b(b) = 1ln(e) = 1, log₁₀(10) = 1

Domain, range, and special values

Logarithms are only defined for positive real numbers:

  • log(0) is undefined. As x approaches 0 from the positive side, log(x) → −∞. This is not a real number.
  • log(negative) is not a real number (it is complex: ln(−x) = ln(x) + πi, but that requires complex arithmetic).
  • log(1) = 0 for any base, because b⁰ = 1.
  • log(x) < 0 when 0 < x < 1 — logarithms of fractions are negative.
xln(x)log₁₀(x)log₂(x)
0.001−6.9078−3−9.9658
0.1−2.3026−1−3.3219
0.5−0.6931−0.3010−1
1000
20.69310.30101
e10.43431.4427
102.302613.3219
1004.605226.6439
10006.907839.9658

Where logarithms appear in real life

Logarithms compress wide-ranging data into manageable scales and appear wherever growth, decay, or sensitivity follows a multiplicative pattern:

  • Finance: The Black-Scholes option pricing formula uses ln(S/K) to model stock price ratios. Continuous compounding uses e^(r·t). Annualised returns compound multiplicatively, so log-returns add, making statistics tractable.
  • Science: pH, sound decibels, earthquake magnitude, star brightness (apparent magnitude) and stellar luminosity all use log-scaled measurements.
  • Statistics: Log-normal distributions model stock prices, city sizes, and income distributions. Log transformation normalises right-skewed data.
  • Computer science: Time complexity of divide-and-conquer algorithms (merge sort = O(n log₂ n)), binary search (O(log₂ n)), and Shannon entropy all use log₂.