Logarithm Calculator

Type a number and a base. You get the power the base must be raised to to give your number, plus the natural, common and binary logarithms.

How it works

The logarithm of x in base b is the power you raise b to in order to get x. Log base 10 of 1,000 is 3, because 10 to the power 3 is 1,000.

Any base is worked out with the change-of-base rule: ln x divided by ln b. When x is an exact power of the base, the answer is cleaned to the whole number, so you see 3 and not 2.9999999999999996.

The natural logarithm (base e), the common logarithm (base 10) and the binary logarithm (base 2) are shown too. Everything runs on this page.

How to use it

  1. 1 Type the number you want the logarithm of.
  2. 2 Type the base, or e for the natural logarithm.
  3. 3 Read the answer at the top, with a note on whether it is exact.
  4. 4 Read ln, log10 and log2 of the same number below.

Good to know

  • To solve 2 to the power x equals 100 for x, take log base 2 of 100. The answer is about 6.644.
  • A base between 0 and 1 is allowed. Log base 0.5 of 8 is -3, because 0.5 to the -3 is 8.
  • Scientific notation works for the number, so 6.02e23 is read as 6.02 × 10^23.
  • Answers are rounded to 10 significant digits unless they are exact whole numbers.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Logarithms in plain terms: the question a logarithm answers

A logarithm answers one question: what power do I raise this base to, to get this number? Log base 10 of 1,000 is 3, because 10 × 10 × 10 is 1,000. Log base 2 of 1,024 is 10, because ten 2s multiplied together make 1,024. A logarithm undoes a power in the same way that division undoes multiplication.

Three bases come up so often they have their own names. The common logarithm, base 10, counts orders of magnitude: a number with log10 of 6 is a million. The decibel scale for sound and the pH scale for acidity are built on it. The natural logarithm, ln, uses base e, about 2.718281828. It appears wherever growth is continuous, such as compound interest, population growth and radioactive decay. The binary logarithm, base 2, counts halvings and doublings. It tells you that 1,024 items can be searched in 10 steps by halving, and that a number below 256 fits in 8 bits.

A logarithm in any other base comes from the change-of-base rule. Log base b of x equals ln x divided by ln b. To find how many years money takes to double at 7% a year, take log base 1.07 of 2. That is ln 2 divided by ln 1.07, about 10.24 years. The same rule turns a question such as "2 to what power gives 100" into a division: log base 2 of 100 is about 6.644.

Dividing two logarithms on a computer leaves tiny rounding errors. Ln 1,000 divided by ln 10 comes out as 2.9999999999999996 in most programming languages, not 3. This calculator checks whether the answer is within a hair of a whole number and whether the base raised to that whole number gives your number back. If both are true, it shows the exact whole number and says so. Otherwise it rounds to 10 significant digits.

Some limits are worth knowing. The number must be greater than 0, and the base must be greater than 0 and not 1, because no other case has a real answer. The tool does not give complex logarithms. Inputs must fit in an ordinary decimal, which goes up to about 1.8 × 10^308, so a number with more than 308 digits is refused. Results that are not exact are accurate to the 10 significant digits shown.

Frequently asked questions

What is the difference between log and ln?

On most calculators, log means base 10 and ln means base e, about 2.718. In maths and in many programming languages, log on its own often means base e instead. This tool names the base on every row, so there is no doubt.

Why can I not take the logarithm of 0 or a negative number?

No power of a positive base gives 0 or a negative number. Raising 10 to any power always gives something above 0, so log 0 and log -5 have no real answer.

Why can the base not be 1?

Every power of 1 is 1. No power of 1 reaches any other number, so a logarithm in base 1 has no answer.

How do I work out a logarithm in a base my calculator does not have?

Divide two logarithms in a base it does have. Log base 3 of 81 is ln 81 divided by ln 3, which is 4. This tool does that for you, for any base.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.