Logarithm Calculator

A logarithm answers “what power gives this number?”. log₂ 8 = 3 because 2³ = 8. This calculator gives the logarithm in any base, plus ln x, log₁₀ x and log₂ x: for x = 8, they are 3, 2.0794, 0.9031 and 3.

Last updated · By · Runs in your browser, nothing is uploaded

Result

Step-by-Step Solution

Enter your values above to see the full working.

What Is a Logarithm?

A logarithm is the inverse of an exponent. If bʸ = x, then log_b x = y. The logarithm of x to the base b tells you which power you must raise b to in order to get x. So log₂ 8 = 3, because 2 × 2 × 2 = 8, and log₁₀ 1,000 = 3, because 10³ = 1,000.

Logarithms turn multiplication into addition and powers into multiplication, which made them the calculator of the pre-computer age. Today they remain essential for anything that spans huge ranges of scale: earthquake magnitude, sound intensity, acidity, star brightness and compound growth.

The Three Common Bases

NameNotationBaseTypical use
Common logarithmlog x or log₁₀ x10Science, pH, decibels
Natural logarithmln xe ≈ 2.71828Calculus, growth and decay
Binary logarithmlog₂ x2Computing, information, doubling

Logarithm Rules

log_b x = y ⇔ bʸ = x log_b (xy) = log_b x + log_b y log_b (x/y) = log_b x − log_b y log_b (xᵖ) = p · log_b x log_b x = ln x ÷ ln b (change of base)
  • b is the base. It must be positive and not equal to 1.
  • x is the number, which must be positive. The logarithm of zero or a negative number is not a real number.
  • The change-of-base formula lets you compute any logarithm with a natural-log or common-log button.
  • Special values: log_b 1 = 0 and log_b b = 1 for every base.

To solve equations with the unknown in an exponent, see the exponential equation calculator.

How Is It Calculated? Worked Examples

log₂ 8

  1. Ask: 2 to what power equals 8?
  2. 2³ = 8, so log₂ 8 = 3.
  3. Change of base check: ln 8 ÷ ln 2 = 2.0794 ÷ 0.6931 = 3 ✓.
  4. The same number in other bases: ln 8 = 2.0794, log₁₀ 8 = 0.9031.

More Logarithms

ExpressionValueBecause
log₁₀ 1,000310³ = 1,000
log₂ 0.125−32⁻³ = 1/8
log₅ 12535³ = 125
log₂ 505.6439between 2⁵ = 32 and 2⁶ = 64
ln e1e¹ = e

Solving 2ˣ = 50

Take the logarithm of both sides: x = log₂ 50 = ln 50 ÷ ln 2 = 3.9120 ÷ 0.6931 = 5.6439.

How Long to Double Your Money?

At 5% annual interest, money doubles when 1.05ᵗ = 2, so t = log₁.₀₅ 2 = ln 2 ÷ ln 1.05 = 14.2 years.

How to Use This Logarithm Calculator

  1. Enter the number x. It must be positive.
  2. Enter the base b. It must be positive and not equal to 1.
  3. Read log_b x, together with ln x, log₁₀ x and log₂ x.
  4. Open the steps to see the change-of-base calculation.

Where Logarithms Are Used

  • Chemistry: pH = −log₁₀[H⁺]. A concentration of 10⁻⁷ mol/L gives pH 7.
  • Earth science: each whole step on the Richter scale is a tenfold increase in measured amplitude.
  • Acoustics: decibels use log₁₀ of intensity ratios.
  • Finance: time to reach a target under compound growth.
  • Computer science: binary search takes about log₂ n steps, and n bits can represent 2ⁿ values.
  • Data analysis: log scales compress data spanning many orders of magnitude.

Logarithmic Scales in Practice

On the Richter scale, a magnitude 7 quake produces ground motion 10² = 100 times larger than a magnitude 5. In acoustics, the level in decibels is 10 log₁₀(I ÷ I₀), so doubling the sound intensity adds only 10 log₁₀ 2 = 3.01 dB. In computing, the number of bits needed to label 1,000 distinct values is ⌈log₂ 1,000⌉ = ⌈9.97⌉ = 10.

Expanding and Condensing

Rules let you rewrite expressions: log₂(8x) = log₂ 8 + log₂ x = 3 + log₂ x, and log₁₀(100x²) = 2 + 2 log₁₀ x.

What Are the Most Common Mistakes With the Logarithm Calculator?

  • Taking the log of zero or a negative number. It is undefined in the real numbers.
  • Using base 1. Every power of 1 is 1, so a base of 1 makes no sense.
  • Writing log(a + b) = log a + log b. The rule is for products: log(ab) = log a + log b.
  • Mixing up log and ln. “log” can mean base 10 or base e depending on the field, so check.
  • Forgetting the change of base. To compute log₅ 125 with a calculator, divide ln 125 by ln 5.
  • Dropping the exponent rule. log(x³) = 3 log x, not (log x)³.

Where Can You Verify These Formulas?

The definitions and formulas on this page follow standard references. Check them against these sources:

Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.

Frequently Asked Questions

What is a logarithm?

It is the exponent to which a base must be raised to produce a number. log₂ 8 = 3 because 2³ = 8.

What is the difference between log and ln?

log usually means base 10 and ln means base e (natural logarithm). In some computing and maths contexts log means base 2 or base e, so always check.

How do I calculate a logarithm with a different base?

Use change of base: log_b x = ln x ÷ ln b. For log₂ 50: 3.9120 ÷ 0.6931 = 5.6439.

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

No real power of a positive base gives a negative result, so the logarithm of a negative number is not a real number.

What are the main logarithm rules?

Product: log(xy) = log x + log y. Quotient: log(x/y) = log x − log y. Power: log(xᵖ) = p log x.

What is the logarithm of 1?

It is 0 in every base, because any base to the power 0 equals 1.