Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Logarithm Calculator

Evaluate log⁡b(x)\log_b(x) in any base, including ee and 10, or solve bx=yb^x = y and log⁡b(x)=c\log_b(x) = c, with exact answers whenever the numbers allow.

Any positive number except 1, or e for the natural log.

Examples

About the Logarithm Calculator

A logarithm answers one question: to what power must the base be raised to give this number? Since 25=322^5 = 32, log⁡232=5\log_2 32 = 5. Logarithms undo exponentials, which makes them the tool for solving any equation where the unknown sits in an exponent, from compound interest to pH and decibels.

The calculator has three modes. Evaluate finds log⁡b(x)\log_b(x), giving an exact rational answer such as log⁡48=32\log_4 8 = \tfrac32 when xx is a rational power of bb and a change-of-base expression with a decimal value otherwise. Solve bx=yb^x = y finds the exponent, and solve log⁡b(x)=c\log_b(x) = c finds the argument. Bases may be any positive number other than 1, or ee for the natural logarithm.

What is a logarithm?

For a base b>0b > 0 with b≠1b \ne 1 and a number x>0x > 0, log⁡bx=y\log_b x = y means exactly by=xb^y = x. The two statements are the same fact written in two ways, and converting between them is the key skill.

Two bases have special names. The common logarithm log⁡x\log x uses base 10, and the natural logarithm ln⁡x\ln x uses base e≈2.71828e \approx 2.71828, which arises naturally in growth, calculus and probability. Logarithms of zero and negative numbers are not defined in the real numbers, because no power of a positive base is zero or negative.

How to use the Logarithm Calculator

  1. Choose a mode: Evaluate, Solve b^x = y, or Solve log_b(x) = c.
  2. Enter the base: a positive number other than 1, 10 for the common log, or e for the natural log.
  3. Enter the number x (for Evaluate) or the right-hand side (for the equation modes). Fractions such as 1/8 are allowed.
  4. Press Calculate. Read how the number was written as a power of the base, or which change-of-base step was used.

Formulas

Definition

log⁡bx=y  ⟺  by=x\log_b x = y \iff b^y = x

Product rule

log⁡b(MN)=log⁡bM+log⁡bN\log_b(MN) = \log_b M + \log_b N

Quotient rule

log⁡bMN=log⁡bM−log⁡bN\log_b\frac{M}{N} = \log_b M - \log_b N

Power rule

log⁡b(Mk)=klog⁡bM\log_b(M^k) = k\log_b M

Change of base

log⁡bx=ln⁡xln⁡b\log_b x = \frac{\ln x}{\ln b}

Worked example: log₄(8)

The example evaluates log⁡48\log_4 8. Neither number is a power of the other, but both are powers of the same prime: 4=224 = 2^2 and 8=238 = 2^3. The engine rewrites the question as (22)y=23(2^2)^y = 2^3, so 2y=32y = 3.

The exact answer is therefore 32\tfrac32, and indeed 43/2=(4)3=84^{3/2} = (\sqrt4)^3 = 8.

The solution below is generated by the same engine that powers the calculator above.

Final answer

log⁡4(8)=32\log_{4}\left(8\right) = \frac{3}{2}

How we read your problem

Evaluate the logarithm of 8 with base 4.

log⁡4(8)\log_{4}\left(8\right)

Step-by-step solution

  1. Ask: what power of the base gives the number?

    4 y=84^{\,y} = 8
  2. Write both numbers as powers of the same prime factors

    Comparing prime exponents shows 8 = 4^(3/2).

    8=4328 = 4^{\frac{3}{2}}

Formulas used

  • Definition

    log⁡bx=y  ⟺  by=x\log_b x = y \iff b^y = x
  • Change of base

    log⁡bx=ln⁡xln⁡b\log_b x = \frac{\ln x}{\ln b}
  • Laws

    log⁡b(MN)=log⁡bM+log⁡bN,log⁡bMk=klog⁡bM\log_b(MN) = \log_b M + \log_b N,\quad \log_b M^k = k\log_b M

4 raised to 3/2 gives 8 exactly.

Verification

  • Check: 4^1.5 ≈ 8.

Detailed explanation

Exact values versus change of base

When the number and base share a common prime base, the logarithm is a rational number and can be found exactly, as in log⁡279=23\log_{27} 9 = \tfrac23 or log⁡218=−3\log_2 \tfrac18 = -3. The calculator factors both into prime powers and compares exponents, so these answers come out exact.

Most logarithms are irrational. For log⁡50\log 50, there is no exact rational value, so the calculator writes the change-of-base form ln⁡50ln⁡10\frac{\ln 50}{\ln 10} and gives the decimal 1.69897…1.69897\ldots. The change-of-base rule works because if y=log⁡bxy = \log_b x then by=xb^y = x, and taking natural logs gives yln⁡b=ln⁡xy \ln b = \ln x.

Solving exponential equations

To solve 2x=102^x = 10, take the logarithm of both sides. The power rule brings the unknown down: xln⁡2=ln⁡10x \ln 2 = \ln 10, so x=ln⁡10ln⁡2=log⁡210≈3.32193x = \frac{\ln 10}{\ln 2} = \log_2 10 \approx 3.32193. A quick check: 23=82^3 = 8 and 24=162^4 = 16, so the answer must lie between 3 and 4.

An equation such as 2x=−42^x = -4 has no real solution, because a positive base raised to any real power is positive. The calculator reports this instead of returning a value.

Solving logarithmic equations

To solve log⁡3x=4\log_3 x = 4, rewrite it in exponential form: x=34=81x = 3^4 = 81. The solution must be positive, since logarithms are only defined for positive arguments; in more complicated equations, always check candidate answers against this condition.

Using the log rules together

The product, quotient and power rules mirror the exponent laws, because logarithms are exponents. They let you expand a single logarithm into simpler pieces, as in log⁡2(8x3)=3+3log⁡2x\log_2(8x^3) = 3 + 3\log_2 x, or condense several logarithms into one, as in ln⁡6−ln⁡2=ln⁡3\ln 6 - \ln 2 = \ln 3. Condensing is usually the first move when an equation contains more than one logarithm, since a single log can then be converted to exponential form.

Common mistakes

  • Writing log⁡(a+b)=log⁡a+log⁡b\log(a + b) = \log a + \log b. The product rule is for log⁡(ab)\log(ab), not sums.
  • Dividing logs incorrectly: log⁡alog⁡b\frac{\log a}{\log b} is not log⁡(a−b)\log(a - b) or log⁡ab\log\frac ab.
  • Taking the log of zero or a negative number.
  • Confusing log⁡\log (base 10) with ln⁡\ln (base ee) on a calculator.
  • Forgetting that log⁡b1=0\log_b 1 = 0 and log⁡bb=1\log_b b = 1 for every valid base.

Tips

  • Translate to exponential form first whenever you are unsure what a log means.
  • Estimate with nearby powers before computing: log⁡210\log_2 10 is a little more than 3.
  • Use prime factorisations to spot exact answers, such as log⁡832=53\log_8 32 = \tfrac53.
  • Keep answers in exact log form until the final step if your course allows it.

Frequently asked questions

What is the difference between log and ln?

log usually means base 10, the common logarithm, and ln means base e, the natural logarithm. Both follow the same rules; they differ only by a constant factor.

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

A positive base raised to any real power is always positive, so no real exponent gives zero or a negative number. Those logarithms are undefined in the real numbers.

How does the change of base formula work?

Log base b of x equals ln x divided by ln b. It lets you compute a logarithm in any base using a calculator that only has ln or log buttons.

When is a logarithm a whole number or a fraction?

When the number is a rational power of the base. For example log base 4 of 8 is 3/2 because 4 to the 3/2 is 8. Otherwise the logarithm is irrational.

How do I solve an equation with the variable in the exponent?

Take the logarithm of both sides and use the power rule to bring the exponent down, then divide. For 2 to the x equals 10, x equals ln 10 divided by ln 2.

Why can't the base be 1?

Every power of 1 equals 1, so log base 1 could not distinguish between numbers and would not be a function.

What are logarithms used for?

They measure quantities that span many orders of magnitude, such as earthquake magnitude, sound level in decibels and acidity as pH, and they solve growth and decay problems.

Evaluate a logarithm

Pick a mode above and enter your base and number to see the exact answer or the change-of-base calculation.

More math calculators