Logarithm Calculator

Find log_b(x) for any positive x and base, with log₁₀, ln and log₂ alongside and the change-of-base working and check shown.

How we test our calculators
log_b(x) —
log₁₀(x) —
ln(x) —
log₂(x) —
Change of base and check —

What is a logarithm calculator?

A logarithm answers the question "what power do I raise the base to, to get this number?" Because 10³ = 1,000, the logarithm of 1,000 in base 10 is 3, written log₁₀(1000) = 3. Logarithms undo exponents, so they are the tool for solving equations such as 2ˣ = 50, where the unknown is in the exponent.

This logarithm calculator takes an Argument (x) and a Base (b) and returns:

  • log_b(x): the logarithm in your chosen base, to 8 decimal places.
  • log₁₀(x), ln(x) and log₂(x): the same number's common logarithm (base 10), natural logarithm (base e ≈ 2.71828) and binary logarithm (base 2), whatever base you chose.
  • Change of base and check: the working, ln(x) ÷ ln(b), followed by a check that raises the base to the answer and gets x back.

The argument must be greater than 0 and the base must be greater than 0 and not equal to 1. Any other entry shows no result, because no real logarithm exists (the questions below explain why). When the answer is a whole number, such as log₁₀(1000) = 3, the calculator shows it exactly, even though the raw computer division gives 2.9999999999999996.

In the Common Core high school standards, F-LE.A.4 asks students to express the solution of an exponential equation as a logarithm, with base 2, 10 or e, and evaluate it using technology. This calculator handles that evaluation step, and works for other bases too.

Formula

The definition links logarithms and exponents:

log_b(x) = y means bʸ = x, for x > 0, b > 0 and b ≠ 1.

Change of base

The calculator computes natural logarithms directly and finds every other base with the change-of-base formula:

log_b(x) = ln(x) ÷ ln(b)

Any base works in place of e, as long as you use the same one on top and bottom: log_b(x) = log₁₀(x) ÷ log₁₀(b). The common logarithm itself is log₁₀(x) = ln(x) ÷ ln(10). The number e, the base of natural logarithms, is 2.718281828459045… .

Laws of logarithms

For positive x and y and a valid base b:

LawFormulaExample in base 10
Productlog_b(xy) = log_b(x) + log_b(y)log(1000) = log(10) + log(100) = 1 + 2 = 3
Quotientlog_b(x ÷ y) = log_b(x) − log_b(y)log(0.01) = log(1) − log(100) = 0 − 2 = −2
Powerlog_b(xᵏ) = k × log_b(x)log(10⁶) = 6 × log(10) = 6
Log of 1log_b(1) = 0because b⁰ = 1
Log of the baselog_b(b) = 1because b¹ = b

There is no rule for the log of a sum: log(x + y) is not log(x) + log(y).

What the signs tell you

  • With a base greater than 1, log_b(x) is positive when x > 1, zero when x = 1 and negative when 0 < x < 1.
  • With a base between 0 and 1, the signs flip: log0.5(8) = −3, because 0.5⁻³ = 8.

Worked example

Example 1: a whole-number answer

Enter x = 1000 and b = 10. log_b(x) is 3, and the working reads:

Change of base: log_10(1000) = ln(1000) ÷ ln(10) = 6.90775528 ÷ 2.30258509 = 3 → Check: 10^3 = 1000

The other lines give the same number in other bases: log₁₀(x) = 3, ln(x) = 6.90775528 and log₂(x) = 9.96578428, so 2 must be raised to almost 10 to reach 1,000 (2¹⁰ = 1,024).

Example 2: solve 2ˣ = 50

  1. Rewrite with the definition: x = log₂(50).
  2. Enter x = 50 and b = 2. The working reads log_2(50) = ln(50) ÷ ln(2) = 3.91202301 ÷ 0.69314718 = 5.64385619.
  3. The check reads 2^5.64385619 = 50, so x ≈ 5.64385619.

With common logs instead, log₁₀(50) ÷ log₁₀(2) = 1.69897000 ÷ 0.30103000 ≈ 5.6439, the same answer to four decimal places (dividing the rounded values loses the last digits). The answer makes sense: 2⁵ = 32 and 2⁶ = 64, so x is between 5 and 6.

Example 3: how long to double at 5% growth

An amount that grows 5% a year is multiplied by 1.05 each year. To find when $1,000 becomes $2,000, solve 1000 × 1.05ᵗ = 2000.

  1. Divide both sides by 1,000: 1.05ᵗ = 2.
  2. Write it as a logarithm: t = log1.05(2).
  3. Enter x = 2 and b = 1.05. The working reads ln(2) ÷ ln(1.05) = 0.69314718 ÷ 0.04879016 = 14.20669908.

The amount doubles after about 14.2 years. At 6% (b = 1.06) it takes 11.89566105 years. The rule of 72 shortcut estimates 72 ÷ 5 = 14.4 years, close to the exact value.

Example 4: negative logarithms

Enter x = 0.01 and b = 10: the result is −2, because 10⁻² = 1/100 = 0.01, and the check reads 10^-2 = 0.01. Enter x = 8 and b = 0.5: the result is −3, because 0.5⁻³ = 2³ = 8, and the check reads 0.5^-3 = 8.

How to use this calculator

  1. Enter the Argument (x), the number you are taking the logarithm of. It must be greater than 0.
  2. Enter the Base (b): 10 for the common log, 2 for the binary log, or any positive number other than 1.
  3. Read log_b(x) for your base. For the natural log you do not need to type e; read ln(x).
  4. Read Change of base and check to see the working and confirm that b raised to the answer returns x.

Which output to use

  • log₁₀(x) for base-10 problems and orders of magnitude: log₁₀(1,000,000) = 6.
  • ln(x) for continuous growth and decay, and for problems written with e.
  • log₂(x) for doublings and halvings: log₂(1024) = 10 doublings.
  • log_b(x) for any other base, such as a growth factor of 1.05.

Common mistakes

  • Swapping the argument and the base. log₂(8) = 3, but log₈(2) = 1/3. Put the number you are "getting to" in Argument (x).
  • Splitting a sum. log(x + y) is not log(x) + log(y); the product law is about log(xy).
  • Typing a rounded e. Base 2.71828 gives log_b(10) = 2.30258664, while ln(10) is 2.30258509. Use the ln(x) line instead.
  • Assuming "log" always means base 10. Books differ on what a log with no base means, so check your course's notation.

Read more in common log vs natural log and real-world uses of logarithms. To go the other way, from an exponent to a value, use the exponent calculator; for growth with regular deposits, use the compound interest calculator.

Sources

Frequently asked questions

What is the difference between log and ln?

ln means the natural logarithm, base e ≈ 2.71828. log with no base written depends on the book: it often means base 10 in school algebra, but some texts use it for base e. This calculator avoids the problem by labeling every line with its base: log₁₀(x), ln(x), log₂(x) and log_b(x). The two are related by ln(x) = ln(10) × log₁₀(x), with ln(10) = 2.30258509.

How do I use base e?

Read the ln(x) line, which is always calculated from the exact natural logarithm. The Base box takes numbers only, so you cannot type the letter e. If you want e as the main base, type 2.718281828459045; a shorter value such as 2.71828 gives a slightly different answer.

How do I solve an equation like 5 × 3²ᵗ = 405?

Isolate the power first, then take the logarithm. Divide both sides by 5 to get 3²ᵗ = 81. Enter x = 81 and b = 3: the calculator gives log₃(81) = 4, with the check 3^4 = 81. So 2t = 4 and t = 2. This is the form described in Common Core standard F-LE.A.4, a × bct = d, solved with a logarithm.

Why must the argument be positive?

For a positive base, bʸ is positive for every real y. No real power of 10 equals 0 or −5, so log₁₀(0) and log₁₀(−5) do not exist in the real numbers. The calculator shows no result for x ≤ 0. As x gets close to 0, the logarithm (base greater than 1) becomes a larger and larger negative number: log₁₀(0.001) = −3.

Why can't the base be 1, 0 or negative?

Every power of 1 is 1, so log₁(5) would have to answer "what power of 1 gives 5?", which has no answer; in the change-of-base formula it would mean dividing by ln(1) = 0. A base of 0 has the same problem, and with a negative base many powers, such as (−2)0.5, are not real numbers. So the base must be positive and not 1.

Why is my logarithm negative?

With a base above 1, any argument between 0 and 1 gives a negative logarithm: log₂(0.5) = −1 because 2⁻¹ = 0.5. A negative answer is not an error. If both the base and the argument are on the same side of 1, as in log0.5(0.25), the answer is positive.

Why does the check use a rounded number?

The working shows each value rounded to 8 decimal places, but the check is calculated from the unrounded answer. For log₂₇(9) the answer is exactly 2/3, shown as 0.66666667, and the check reads 27^0.66666667 = 9. If you raise 27 to the rounded 0.66666667 on another calculator, you may get a number a tiny bit away from 9.

How many decimal places can I trust?

The results are calculated with ordinary computer floating-point numbers, which keep about 16 significant digits, and are shown to 8 decimal places, more than homework or practical problems need. The last shown digit can be affected by rounding. Answers within a trillionth of a whole number are shown as that whole number, so log₂(8) shows exactly 3 and log₈(2) shows 0.33333333, which is 1/3 rounded.