Logarithm Calculator (log any base, ln, log10)

Calculate the logarithm of any number in any base using the change-of-base formula, with the natural log (ln), log base 10 and log base 2 side by side.

Leave the base empty, or type e, for the natural log (base e).

log10(1000) = 3
ln(1000)   = 6.90775527898
log2(1000) = 9.96578428466

The working

log10(1000) = ln(1000) / ln(10) = 6.90775527898 / 2.30258509299 = 3

Check: 10^3 = 1000 ✓

Change of base: the log in any base is ln(x) divided by ln(b).

The log rules, with these numbers

Product rule: log10(1000 × 10) = log10(1000) + log10(10) = 3 + 1 = 4

Quotient rule: log10(1000 ÷ 10) = log10(1000) − log10(10) = 3 − 1 = 2

Power rule: log10(1000²) = 2 × log10(1000) = 2 × 3 = 6

Reciprocal: log10(1/1000) = −log10(1000) = -3

Base switch: log10(1000) = 1 / log1000(10) = 1 / 0.333333333333 = 3

Log of 1: log10(1) = 0

Log of the base itself: log10(10) = 1

What this calculator does

Enter a number x and a base, and this tool instantly returns the log of x in the base you chose and, beside it, whichever of the natural logarithm ln(x) (base e), the common logarithm log10(x) (base 10) and the binary logarithm log2(x) (base 2) that base is not. The answer to a logarithm is the exponent you would raise the base to in order to get x — for example log2(8) is 3 because 2 raised to the 3rd power equals 8. Every result updates live as you type, and each one has its own copy button so you can drop the value straight into your homework, spreadsheet, or code.

The change-of-base formula

Most calculators only offer ln and log10, but this tool computes a logarithm in any base using the change-of-base formula: log in base b of x equals ln(x) divided by ln(b) (equivalently Math.log(x) / Math.log(base) in JavaScript). That is why the same engine can answer log base 2, base 5, base 16, or any positive base other than 1. The logarithm is undefined when x is zero or negative, and the base must be a positive number that is not 1, so those inputs are flagged instead of returning a misleading value.

Frequently asked questions

How do I calculate a log in a base other than 10 or e?

Type your number into the x field and the base you want into the base field. The tool uses the change-of-base formula — ln(x) divided by ln(base) — so it handles any positive base except 1, including base 2, base 5, and base 16.

Why does the calculator refuse some numbers?

Logarithms are only defined for numbers greater than 0, so x must be positive. The base must also be greater than 0 and cannot equal 1, because 1 raised to any power is always 1. When an input breaks these rules the tool shows a short message instead of a wrong answer.

Can it find the base or the antilog, and round the answer?

Yes. “Solve for” turns the tool around: give the base and the result to get the number back (the antilog), or the number and the result to get the base. The change-of-base working is shown with your numbers, and you choose how many decimal places.

Is log base 2 on the page, can I use e as the base, and can I check the answer?

Yes. The answers show log2 beside ln and log10 — whichever of the three your base is not — and the “Common bases” buttons (log₂, ln, log₁₀) set the base in one press. Leaving the base empty, or typing e, gives the natural log, written ln with e in the working rather than 2.71828…. A “Check” line puts the answer back through the definition — the base raised to the logarithm found, with a tick when it lands back on x — and the folded “The log rules, with these numbers” works the product, quotient, power, reciprocal and base-switch rules through your own x and base.