How Logarithms Work: log, ln, log₂ and the Change of Base Formula

Logarithms explained from scratch: what log, ln and log₂ mean, the log laws, the change of base formula, antilogs, and solving exponential equations.

Updated September 29, 2026 6 min read

Use the free Logarithm Calculatorlog base b, ln and log10 with change of base, antilog and base solving

Logarithms have a reputation for being abstract, yet they answer a very practical question: "how many times do I need to multiply by this number to reach that one?" How many doublings until a file reaches 1 GB? How many years at 7% growth until an investment doubles? Why does the decibel scale go up by 10 when sound energy is multiplied by 10?

This guide explains what a logarithm is, the difference between log, ln and log₂, the three laws that make logs useful, the change of base formula your calculator relies on, and how to use logs to solve equations where the unknown is in the exponent. Every result was checked with our calculator.

A logarithm is an exponent

The definition in one line:

log_b(x) = y   means   bʸ = x

The logarithm is the exponent you need to put on the base b to get x.

  • log₂(64) = 6, because 2⁶ = 64.
  • log₁₀(1,000) = 3, because 10³ = 1,000.
  • log₁₀(0.01) = −2, because 10⁻² = 0.01.
  • log₂(1/8) = −3, because 2⁻³ = 1/8.

Three restrictions follow from the definition. The base must be positive and not equal to 1 (1 to any power is 1, so it cannot reach other numbers). The input x must be positive, because a positive base raised to any real power is positive. And log_b(1) = 0 for every base, since b⁰ = 1.

The three common bases

Notation Base Where you see it
log or log₁₀ 10 Orders of magnitude, pH, decibels, the Richter-style scales
ln e ≈ 2.71828 Continuous growth and decay, calculus, statistics
log₂ or lb 2 Computing: bits, doublings, binary search

Be careful with plain "log". In school maths and on calculators it usually means base 10. In many programming languages and in higher mathematics it means the natural log, ln. When in doubt, check the documentation.

The laws of logarithms

Because logs are exponents, the exponent laws turn into log laws:

log_b(xy)   = log_b(x) + log_b(y)
log_b(x/y)  = log_b(x) − log_b(y)
log_b(xⁿ)   = n × log_b(x)

These are why logs were invented: they turn multiplication into addition. Before electronic calculators, people multiplied large numbers by adding their logarithms from printed tables.

For example, log₁₀(3,500,000) = log₁₀(3.5) + log₁₀(10⁶) ≈ 0.5441 + 6 = 6.5441. The whole-number part tells you the order of magnitude, and adding 1 to it gives the number of digits before the decimal point: 7.

The change of base formula

Most calculators only have keys for log₁₀ and ln. To find a log in any other base, divide:

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

Example: log₃(50)

ln 50 ≈ 3.912023
ln 3  ≈ 1.098612
log₃(50) ≈ 3.912023 ÷ 1.098612 ≈ 3.560877

Check: 3^3.560877 ≈ 50. It does not matter whether you use ln or log₁₀, as long as you use the same one top and bottom.

Some logs are exact fractions even when they look awkward. log₈(4) = 2/3, because 8^(2/3) = (cube root of 8)² = 2² = 4.

Antilogs: going back

The antilog undoes a logarithm. If log_b(x) = y, then x = bʸ.

  • If log₁₀(x) = 2.5, then x = 10^2.5 ≈ 316.228.
  • If ln(x) = 3, then x = e³ ≈ 20.0855.

Antilogs are how you convert pH back to a hydrogen-ion concentration or a decibel level back to a power ratio.

Solving exponential equations

When the unknown is in the exponent, take logs of both sides and bring the exponent down with the power law.

Example: 2ˣ = 10

x = log₂(10) = ln 10 ÷ ln 2 ≈ 3.321928

That is also the number of bits needed per decimal digit: about 3.32.

Example: doubling time at 7% growth. Solve 1.07ⁿ = 2:

n = ln 2 ÷ ln 1.07 ≈ 10.24 periods

The quick "rule of 72" (72 ÷ 7 ≈ 10.3) is an approximation of this exact log calculation. For growth models built on this idea, see the Exponential Growth Calculator.

Example: finding the base. If log_b(81) = 4, then b⁴ = 81, so b = 81^(1/4) = 3.

How to use the Logarithm Calculator

The Logarithm Calculator has three tabs for the three questions above.

  1. Find log — choose a Base: 10 (log), e (ln), 2 or Custom (then enter Base b). Type the number into x (the number). The result is exact when possible, such as 6 for log₂(64) or 2/3 for log₈(4), and otherwise shown to 12 significant digits. Extra rows show ln x, log₁₀ x and log₂ x together.
  2. Solve for x — choose the base and enter y (the logarithm / exponent). The tool gives the antilog x = bʸ and checks it.
  3. Solve for base — enter x and y to find the base b that satisfies log_b(x) = y.

The steps show the change of base calculation with both ln and log₁₀, followed by a check. The x field also accepts expressions such as 2^10 or sqrt(8).

Other ways to calculate logs

  • Scientific calculators: use LOG for base 10 and LN for base e. Some newer models have a log_b key; otherwise use change of base.
  • Spreadsheets: =LOG10(1000), =LN(20) and =LOG(50,3) for a custom base. Note that in Excel, =LOG(x) with no base means base 10.
  • Programming: languages usually provide log (natural), log10 and log2. Python's math.log(50, 3) takes a base as a second argument.

For the reverse operation, raising a base to a power, use the Exponent Calculator. For key sequences on a physical calculator, the guide to using a scientific calculator covers log and ln buttons.

Common mistakes

log(x + y) is not log x + log y

The addition law applies to products, not sums. log₁₀(10 + 10) = log₁₀(20) ≈ 1.301, not 2.

Taking the log of zero or a negative

Neither has a real logarithm. If a formula produces one, check the inputs.

Mixing bases in change of base

ln on top and log₁₀ below gives a wrong answer. Use the same base for both.

Confusing log and ln

ln 20 ≈ 2.9957 while log₁₀ 20 ≈ 1.3010. Know which your formula expects.

Frequently asked questions

What is the difference between log and ln?

log usually means base 10, while ln always means base e (about 2.71828). They differ by a constant factor: ln x ≈ 2.302585 × log₁₀ x.

How do I calculate a log with a different base on a normal calculator?

Use the change of base formula: log_b(x) = ln(x) ÷ ln(b). For log₃(50), divide ln 50 by ln 3 to get about 3.5609.

Why can't you take the log of a negative number?

A positive base raised to any real power is always positive, so no real exponent can produce a negative number or zero. In complex numbers the log of a negative number exists, but not in the real numbers.

What is an antilog?

It is the inverse of a logarithm. The antilog of y in base b is bʸ, so the base-10 antilog of 2.5 is 10^2.5 ≈ 316.23.

What is log base 2 used for?

It counts doublings. log₂(n), rounded up, tells you how many bits are needed to represent n different values, how many halvings a binary search needs, and how many doublings take one quantity to another.

Try it now: Logarithm Calculator

Loading tool…