Logarithm

Log of a number in any base.

Base
log₁₀(100)
2

How to Use the Log Calculator

  1. Enter the **number (x)** you want to take the logarithm of in the 'Number' field. It must be greater than zero.
  2. Enter the **base (b)** in the 'Base' field. Common bases are 2, 10, or e (approximately 2.71828). The base must be positive and not equal to 1.
  3. Click **Calculate** (or press Enter) to instantly compute log_b(x).
  4. Read the result displayed below the inputs. This is the exponent to which the base must be raised to equal your number.
  5. Use the **Reset** button to clear the fields and start a new calculation.

Logarithm Formula (Change of Base)

log_b(x) = ln(x) / ln(b)

The logarithm log_b(x) asks: 'What exponent do I need to raise b to, in order to get x?' The general formula uses the change-of-base rule, which lets you evaluate any logarithm using the natural log (ln) or common log (log₁₀) that appear on most calculators and in most software:

log_b(x) = ln(x) / ln(b)

This is mathematically equivalent to:

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

Both expressions yield the same result. The answer tells you the exponent to which base b must be raised to produce x.

  • b — The base of the logarithm. Must be a positive real number and cannot equal 1. Common choices are 2 (binary), e ≈ 2.71828 (natural), and 10 (common/decimal).
  • x — The argument (input number) whose logarithm you want. Must be a strictly positive real number (x > 0).
  • ln(x) — The natural logarithm of x — the logarithm with base e. This is used internally to evaluate the change-of-base formula.
  • ln(b) — The natural logarithm of the chosen base b. This serves as the denominator in the change-of-base formula.
  • log_b(x) — The result — the exponent to which base b must be raised to equal x.

Worked Example: log₃(81)

x = 81, b = 3
log₃(81) = ln(81) / ln(3) = 4.39445 / 1.09861 ≈ 4

Result: log₃(81) = 4

What Your Result Means

The result 4 means that 3 raised to the power of 4 equals 81 (3⁴ = 3 × 3 × 3 × 3 = 81). You can always verify a logarithm result by checking that b^(result) = x. In this case, 3⁴ = 81 ✓. If your result is a decimal (for example, log₁₀(50) ≈ 1.69897), it simply means the base must be raised to that fractional power to reach the argument.

Understanding Logarithm

What Is a Logarithm?

A logarithm is the inverse operation of exponentiation. If you know that 10² = 100, then log₁₀(100) = 2. The logarithm 'undoes' the exponent.

Common Bases

| Base | Name | Notation | Common Use | |------|------|----------|------------| | 10 | Common log | log(x) or log₁₀(x) | Engineering, pH, decibels | | e ≈ 2.71828 | Natural log | ln(x) | Calculus, growth/decay models | | 2 | Binary log | log₂(x) | Computer science, information theory |

Key Logarithm Rules

  • Product rule: log_b(xy) = log_b(x) + log_b(y)
  • Quotient rule: log_b(x/y) = log_b(x) − log_b(y)
  • Power rule: log_b(xⁿ) = n · log_b(x)
  • Change-of-base: log_b(x) = ln(x) / ln(b)
  • Identity: log_b(b) = 1 (any base raised to 1 equals itself)
  • Zero rule: log_b(1) = 0 (any base raised to 0 equals 1)

Where Are Logarithms Used?

  • Science: The Richter scale (earthquakes), pH scale (acidity), and decibel scale (sound) are all logarithmic.
  • Finance: Continuously compounded interest and stock return calculations use the natural log.
  • Computer science: Binary search and sorting algorithm complexity (e.g., O(log n)) relies on log base 2.
  • Mathematics: Solving exponential equations, calculus integrals, and complex number theory.

Domain and Range

The logarithm is only defined for x > 0 and b > 0, b ≠ 1. Attempting to take the log of zero or a negative number produces an undefined (or complex) result in standard real-number math.

Common Mistakes

  • **Using x ≤ 0:** The logarithm is undefined for zero or negative numbers. Always ensure your argument is strictly positive.
  • **Setting the base to 1:** log₁(x) is undefined for all x because 1 raised to any power always equals 1, never another value.
  • **Confusing ln and log:** ln(x) means log base e, while log(x) without a subscript typically means log base 10 in most scientific contexts (but log base e in many programming languages — always check your tool).
  • **Forgetting the change-of-base rule:** You cannot directly compute log base 7 on a standard calculator without using ln(x)/ln(7) or log(x)/log(7).
  • **Rounding the base e:** Using 2.718 instead of the full value of e introduces small but cumulative rounding errors in natural log calculations.
  • **Interpreting a negative result as an error:** If x < b (e.g., log₁₀(0.01) = −2), the result is legitimately negative — it just means x is a fractional power of the base.

Common Questions About Logarithm

What is the difference between log and ln on a scientific calculator?

On most scientific calculators, the 'log' key computes log base 10, while the 'ln' key computes the natural logarithm (log base e). This calculator lets you specify any base, so you can replicate both by entering 10 or e as the base.

How is a logarithm used in compound interest calculations?

The natural log is used to solve for time in the continuous compound interest formula. If A = Pe^(rt), then t = ln(A/P) / r. This tells you how long it takes for an investment to reach a target value.

What is log₂(n) used for in computer science?

log₂(n) tells you how many times you can halve a dataset of size n before reaching a single element. This is why binary search and balanced binary tree operations run in O(log₂ n) time — it represents the number of decision steps needed.

Can logarithms be used to solve exponential equations?

Yes. To solve an equation like 5^x = 200, take the log of both sides: x = log₅(200) = ln(200)/ln(5) ≈ 3.292. Logarithms are the standard algebraic tool for isolating exponents.

What happens when the base is a fraction, like log_(0.5)(x)?

A base between 0 and 1 produces a decreasing (negative-slope) logarithm. For example, log_(0.5)(8) = −3, because (0.5)^(−3) = 2³ = 8. The result is negative when x > 1 and positive when 0 < x < 1.

Frequently Asked Questions

What is log base 10 of 1000?

log₁₀(1000) = 3, because 10³ = 1000.

What is the natural log (ln) and how is it different from log?

The natural log, written ln(x), is the logarithm with base e (≈ 2.71828). The 'common log', written log(x), uses base 10. They are related by ln(x) = log(x) / log(e) ≈ log(x) / 0.43429.

Can I calculate log base 2 (binary log) with this calculator?

Yes. Enter your number in the Number field and type 2 as the base. For example, log₂(1024) = 10.

Why is the logarithm undefined for negative numbers?

There is no real-number exponent you can raise a positive base to and get a negative result. For example, 10^x is always positive regardless of x, so log₁₀(−5) has no real solution.

What does a logarithm result of 0 mean?

A result of 0 means the argument equals 1, because b⁰ = 1 for any valid base b. So log_b(1) = 0 always.

How do I verify my logarithm answer?

Raise the base to the power of your result and check if you get the original number. If log_b(x) = y, then b^y should equal x. For example, log₅(125) = 3, and 5³ = 125 ✓.

Related Calculators

Sources

Only sources that have been reviewed are shown. Unverified citations are never published.

Spotted a calculation error?Report an Error