Logarithm calculator

Evaluate logarithms in any base, with the change-of-base step shown.

Advertisement

How to use this calculator

Enter the value and pick a base, common log (10), natural log (e), binary log (2), or your own custom base.

How it works

Custom bases use the change-of-base formula: logb(x) = ln(x) ÷ ln(b). The calculator shows this division so you can verify it.

logb(x) = y means by = x

Worked example

log10(1000): 10³ = 1000, so the answer is 3.

Common mistakes

  • Logs of zero or negative numbers are undefined, the calculator will say so.
  • Mixing up ln (base e) and log (base 10).

When to use it

Exponential growth/decay, pH, decibels, and algorithm complexity.

Frequently asked questions

log usually means base 10; ln always means base e (≈ 2.718).

Not in real numbers, the calculator reports it as undefined.

Useful log rules for quick estimates

Three short rules explain most values this calculator returns. A log of 1 is always 0, because any base to the power 0 equals 1. A log of the base itself is 1. And a log grows slowly: multiplying the input by the base adds exactly 1 to the result, which is why each extra digit in base 10 adds about 1.

log_b(1) = 0, log_b(b) = 1, and log_b(b x) = 1 + log_b(x)

These rules also give a sanity check. If your input sits between two powers of the base, the answer must sit between the two matching whole numbers, closer to the end the input is nearer to.

Example: Find log_2(40), the number of doublings to pass 40

Step 1, Bracket the value: 32 = 2^5 and 64 = 2^6, so log_2(40) lies between 5 and 6.

Step 2, Apply change of base: log_2(40) = ln(40) / ln(2).

Step 3, Divide: ln(40) is about 3.6889 and ln(2) is about 0.6931, so the quotient is about 5.3219.

Step 4, Check by raising the base: 2^5.3219 is approximately 40, which confirms the result. So about 5.32 doublings take 1 to 40.

A quick check you can do by hand

Before trusting any log result, reverse it. Raise the base to your answer and see whether you land back on the number you started with, allowing for rounding in the last decimal place. This ten second check catches the most common slip, which is entering the value and the base in the wrong boxes. The calculator is free to use, so you can also test a nearby round number, such as a perfect power, and confirm the output behaves as the rules above predict.

More questions

It is always 0, whatever the base, because b^0 = 1 for every valid base. In the same way, log_b(b) is always 1, because b^1 = b.

Divide by ln(10), which is about 2.3026. So log_10(x) = ln(x) / 2.3026. For example, ln(100) is about 4.6052, and 4.6052 / 2.3026 = 2, matching log_10(100) = 2.

Because you need a negative power to make a base bigger than 1 shrink below 1. For instance, log_10(0.01) = -2, since 10^-2 = 0.01. The input is still positive, so the log is defined.