Free Logarithm Calculator

Enter a value x and a base b and this calculator returns logₐ(x) using the change-of-base formula ln(x) ÷ ln(b), alongside the natural log (ln x) and common log (log₁₀ x). It handles any positive base except 1 and flags x ≤ 0, since the real logarithm is undefined there.

Enter the value x and a base b to find logₐ(x) = ln(x) ÷ ln(b). The natural log (ln) and common log (log₁₀) of x are shown too. Use base 10 for the common log, 2 for binary, or about 2.71828 for the natural log.

Result
log10(1000) = 3
Natural log — ln(x)6.90776
Common log — log₁₀(x)3
Change-of-base checkln(x)/ln(b) = 6.90776/2.30259

logₐ(x) answers the question “to what power must I raise b to get x?” By the change-of-base formula it equals ln(x) ÷ ln(b), so any base can be computed from natural logs. logₐ(1) is always 0 and logₐ(b) is always 1.

Quick answer

A logarithm logₐ(x) is the exponent you must raise the base b to in order to get x, and it is computed with the change-of-base formula logₐ(x) = ln(x) ÷ ln(b). For example, log₁₀(1000) = ln(1000) ÷ ln(10) = 6.90776 ÷ 2.30259 = 3, because 10³ = 1000. This calculator evaluates logₐ(x) for any base b > 0 (b ≠ 1) and also reports ln(x) and log₁₀(x) for the same value.

Formula & method

Change-of-base formula (any base)

logₐ(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b)
  • x the argument — the positive number you are taking the log of (x > 0)
  • b the base of the logarithm (b > 0 and b ≠ 1; default 10)
  • ln natural logarithm, the logarithm to base e ≈ 2.71828

Because the ratio of two logs cancels the original base, you can pick ln, log₁₀, or any consistent base in the numerator and denominator and get the same answer. log₁₀ is the common log; ln is the natural log.

Definition of a logarithm

logₐ(x) = y  ⟺  bʸ = x

The log is the inverse of exponentiation. Two identities follow directly: logₐ(1) = 0 (since b⁰ = 1) and logₐ(b) = 1 (since b¹ = b).

Examples

Example 1: Common log of 1000 (base 10)
Input
x = 1000, b = 10
Result
log₁₀(1000) = 3
Why
Apply the change-of-base formula: ln(1000) ÷ ln(10) = 6.90776 ÷ 2.30259 = 3. This matches the definition because 10³ = 1000 — the power of 10 needed to reach 1000 is exactly 3. The natural log of 1000 is 6.90776 and the common log is 3.
Example 2: Binary log of 64 (base 2)
Input
x = 64, b = 2
Result
log₂(64) = 6
Why
Compute ln(64) ÷ ln(2) = 4.15888 ÷ 0.693147 = 6, since 2⁶ = 64. Base-2 logs count how many times you can halve a number before reaching 1, which is why they appear in computing (bits, tree depth, binary search).
Example 3: Log that returns a negative result
Input
x = 0.2, b = 5
Result
log₅(0.2) = −1
Why
Here x is a fraction less than 1, so the exponent is negative: ln(0.2) ÷ ln(5) = −1.60944 ÷ 1.60944 = −1, because 5⁻¹ = 1/5 = 0.2. Logs of numbers between 0 and 1 are always negative when the base is greater than 1.

When to use this tool

  • Solving exponential equations such as bˣ = N for the unknown exponent x, where x = logₐ(N) — common in compound interest, half-life, and growth/decay problems.
  • Working in bases your handheld calculator lacks a button for (e.g. log₅, log₃, log₇): use change of base to evaluate them from ln or log₁₀.
  • Quick reasoning about scale in computing or science — base-2 logs for bits, memory, and algorithm complexity; base-10 logs for pH, decibels, the Richter scale, and orders of magnitude.

Common mistakes

  • Trying to take the log of zero or a negative number. logₐ(x) is only defined for x > 0 in the real numbers; log(0) tends to −∞ and log(−4) has no real value. The calculator flags x ≤ 0 instead of returning a misleading number.
  • Using base 1. Base b must be positive and not equal to 1, because 1 raised to any power is always 1, so log₁(x) cannot pick out a unique exponent (the formula would divide by ln 1 = 0).
  • Confusing ln and log₁₀. In math and many calculators “log” with no base means base 10 (common log), while “ln” means base e (natural log). Plugging a natural-log value where a base-10 value is expected (or vice versa) shifts every answer by a constant factor of ln(10) ≈ 2.3026.
  • Forgetting that change-of-base works with any base. logₐ(x) = ln(x)/ln(b) and log₁₀(x)/log₁₀(b) give identical results; you do not need a special log button for base 7 or base 3 — just divide two logs of any single base.

Frequently asked questions

What is the difference between log, ln, and log₁₀?

“log₁₀” (often written just “log”) is the common logarithm, base 10. “ln” is the natural logarithm, base e ≈ 2.71828. “logₐ” is the general logarithm to a base b you choose. They differ only by a constant factor: ln(x) = log₁₀(x) × ln(10) ≈ log₁₀(x) × 2.3026. This calculator shows logₐ(x) for your chosen base plus ln(x) and log₁₀(x) for the same x.

How does the change-of-base formula work?

logₐ(x) = ln(x) ÷ ln(b). Any common base works in place of ln, including log₁₀, because the base you pick cancels in the ratio. This is how a calculator computes a base it has no dedicated key for — for log₅(0.2) it divides ln(0.2) by ln(5) to get −1.

Why can't I take the logarithm of a negative number or zero?

A logarithm asks “to what power must I raise the base to get x?” Since a positive base raised to any real power is always positive, no real exponent can produce 0 or a negative result. log(0) heads to −∞, and log(−4) only exists in the complex numbers, so the real-valued calculator rejects x ≤ 0.

Why must the base be greater than 0 and not equal to 1?

A negative or zero base does not give a consistent, single-valued logarithm. Base 1 is excluded because 1 raised to any power is 1, so log₁(x) cannot identify a unique exponent — in the formula it would mean dividing by ln(1) = 0, which is undefined.

What are log of 1 and log of the base itself?

logₐ(1) = 0 for every valid base, because any nonzero base to the power 0 equals 1. And logₐ(b) = 1, because b¹ = b. These two identities are handy checkpoints: if your answer for log₁₀(1) isn’t 0 or log₂(2) isn’t 1, something is off.

Is the answer rounded?

Displayed values are rounded to about 6 significant figures for readability, so an irrational result like log₁₀(50) shows as 1.69897. Clean results such as log₂(64) = 6 or log₁₀(1000) = 3 are shown exactly, because the calculator uses the precise native log for bases 2, e, and 10 to avoid floating-point drift.

Sources & references

External references open in a new tab. We are independent and not affiliated with these organizations.

  • ✓ Free to use
  • ✓ No sign-up required
  • Runs entirely in your browser — nothing is uploaded.
  • ✓ Formula and method shown above

Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.

Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.

Related tools

Embed this tool on your site

Free to embed, no sign-up. Paste this code where you want the logarithm calculator to appear: