Logarithm calculator — log base 10, ln, log base 2 or any base

Enter a positive number and pick a base (10, e, 2 or your own) to get its logarithm to 12 significant figures, along with ln, log₁₀ and log₂ and a power check.

Live demo · real result from this tool
Resultlog₁₀(1,000) = 3
ln x
6.90775527898
log₁₀ x
3
log₂ x
9.96578428466

Check and change of base

10^3 = 1,000log_b(x) = ln(x) / ln(b) = 6.90775527898 / 2.30258509299

Processed on your device — nothing is uploaded.

How to use the logarithm calculator

  1. Type a positive number in Number x.
  2. Choose the Base: 10 (common log), e (natural log, ln), 2 (binary log) or Custom base.
  3. If you chose a custom base, type it in the Custom base box that appears.
  4. Read the Result. The lines below give ln x, log₁₀ x and log₂ x at the same time.
  5. Use the Check and change of base box to see the power check and the ln division the tool used.

What it does and when to use it

A logarithm is the inverse of a power. log_b(x) = y means b^y = x. For example, log₁₀(1000) = 3 because 10³ = 1000.

Logs appear in algebra when you solve equations like 2^x = 100, in science for pH, decibels and earthquake scales, and in computing, where log₂ tells you how many bits or halving steps are needed. If you want to write very large or small numbers as powers of ten, the scientific notation converter is a good partner tool.

How it works

For bases 10, e and 2 the tool calls the built-in functions log10, log and log2. For a custom base it uses the change of base formula:

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

The result is then checked: if it is extremely close to a whole number r and b^r gives x back, r is shown exactly.

Step by step for log₂(100):

  1. Take natural logs: ln(100) = 4.60517018599 and ln(2) = 0.69314718056.
  2. Divide: 4.60517018599 ÷ 0.69314718056 = 6.64385618977.
  3. Check: 2^6.64385618977 = 100.

So 2 must be raised to about 6.64 to give 100. This fits, because 2⁶ = 64 and 2⁷ = 128.

Worked examples

Common log. x = 1000, base 10: log₁₀(1,000) = 3.

Numbers below 1. x = 0.01, base 10: log₁₀(0.01) = -2, because 10⁻² = 0.01. Any number between 0 and 1 has a negative log when the base is above 1.

Custom base. x = 81 with base 3: log_3(81) = 4, since 3⁴ = 81.

A non-whole answer. x = 100, base 2: log₂(100) = 6.64385618977.

Useful log rules

Rule Example
log(a × b) = log a + log b log₁₀(20) = log₁₀ 2 + log₁₀ 10
log(a ÷ b) = log a − log b log₁₀(0.5) = log₁₀ 1 − log₁₀ 2
log(aⁿ) = n × log a log₂(8²) = 2 × 3 = 6
log_b(b) = 1, log_b(1) = 0 ln(e) = 1

Limits and tips

  • The result is a decimal approximation unless it is a whole number. For exact forms such as ½ log 3, work by hand with the rules above.
  • To check an answer with a power, the scientific notation and rounding tools help you tidy long decimals.
  • For growth problems such as “how many doublings?”, combine log₂ with the sequence calculator to see the terms.
  • Calculations run in your browser.

Frequently asked questions

Why can't I take the log of 0 or a negative number?
A logarithm asks "what power of the base gives x?". A positive base raised to any real power is always positive, so no power gives 0 or a negative number. The tool shows a message instead of a result.
What is the difference between log and ln?
In most school books, log means base 10 and ln means base e (about 2.718). Some programming languages and advanced texts use log for base e, so check which one your problem means.
Which bases are allowed?
Any base greater than 0 except 1. Base 1 cannot work because 1 raised to any power is still 1. Fractional bases such as 0.5 are fine and give negative logs for numbers above 1.
Why do I see 3 and not 2.9999999999?
When the computed answer is within a tiny distance of a whole number and that power really gives your number back, the tool shows the whole number. log₁₀(1000) is exactly 3, so it is shown as 3.
How accurate are the other answers?
They come from the computer's standard double-precision maths and are shown to 12 significant figures, which is more than enough for school and most technical work.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close