Social media growth services from EthicalSMM

Logarithm Calculator

Calculate the logarithm of a number in any base, along with the natural log (ln), common log (log10) and binary log (log2).

Was this tool helpful?

Thanks for the feedback!

This calculator finds the logarithm of a positive number in any base you choose. It also shows the natural log (ln), the common log (log base 10) and the binary log (log base 2) of the same number, and checks the answer by raising the base to it. It is handy for school and college maths, chemistry pH problems, computer science and finance questions about growth.

What a logarithm means

A logarithm answers the question "what power do I raise the base to, to get this number?". Since 10³ = 1000, log base 10 of 1000 is 3. Since 2³ = 8, log base 2 of 8 is also 3. In general, if b raised to the power y equals x, then log base b of x equals y.

The fields

  • Number: the value you want the logarithm of. It must be greater than zero.
  • Base (blank = 10, or type e): leave it empty for the common log, type e for the natural log, or enter any positive number other than 1, including decimals such as 1.08.

How the result is worked out

Computers calculate natural logs directly, so the tool uses the change of base rule:

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

The headline is shown to up to 8 decimal places. The ln, log₁₀ and log₂ rows are listed every time, whatever base you entered. The last row, labelled Check, raises your base to the result and should give back your original number, a quick way to confirm you typed what you meant.

Worked examples

NumberBaseResultNotes
1000blank (10)3ln(1,000) is 6.90775528, log₂ is 9.96578428
10242101024 bytes make one kibibyte, 2 to the power 10
50blank (10)1.69897between 1 and 2, since 50 is between 10 and 100
0.001blank (10)-3numbers between 0 and 1 have negative logs
100e4.60517019the natural log, same as the ln row
170the log of 1 is 0 in every base

A money example: how long to double an investment

If a deposit grows at 8% a year, compounded yearly, the number of years it takes to double is log base 1.08 of 2. Enter 2 as the number and 1.08 as the base. The tool gives 9.00646834, so about 9 years. The well-known "rule of 72" (72 ÷ 8 = 9) is a shortcut for this same calculation. Turning ₹1,00,000 into ₹2,00,000 at 8% a year therefore takes a little over 9 years. For full growth projections, the compound interest calculator shows the year-by-year balance.

Two rules worth remembering

The log of a product is the sum of the logs, and the log of a power is the power times the log: log(a × b) = log a + log b, and log(aⁿ) = n × log a. These rules are why logarithms were once used to turn long multiplication into addition. A handy side effect: the number of digits in a whole number is the whole part of its common log plus one. The tool gives log₁₀(50) as 1.69897, so 50 has 1 + 1 = 2 digits.

Where each base is used

  • Base 10 (common log): the pH scale in chemistry (pH is minus the log of the hydrogen ion concentration), decibels in sound and counting the digits in a number in a number.
  • Base e (natural log, e ≈ 2.71828): continuous growth and decay, calculus and most science formulas.
  • Base 2 (binary log): computing, such as how many bits are needed to store a number of values, or how many steps a binary search takes.

Errors the tool reports

  • Zero or a negative number gives "Logarithms are only defined for numbers above zero." No real power of a positive base can produce zero or a negative value.
  • A base of 1, zero or a negative base gives "The base must be a positive number other than 1 (or "e")." Every power of 1 is 1, so it cannot reach any other number.
  • Results are floating point, so a value like 3 may appear as 2.99999999 in rare cases. The check row helps you see that the answer is right.

For writing very large or tiny answers in powers of ten, try the scientific notation converter.

Frequently asked questions

What is the log of 1000 to base 10?
It is 3, because 10 raised to the power 3 equals 1000. Leave the base box empty and the tool uses base 10.
How do I calculate ln on this tool?
Type e in the base box for the natural log. The ln row is also shown for every calculation, so you can read it whatever base you enter.
Why can I not take the log of zero or a negative number?
No real power of a positive base gives zero or a negative result, so the logarithm is undefined there. The tool shows an error asking for a number above zero.
What is the change of base formula?
log base b of x equals ln(x) divided by ln(b). You can use log base 10 instead of ln on both top and bottom and get the same answer.
How many years does it take to double money at 8% interest?
About 9 years with yearly compounding. Log base 1.08 of 2 is 9.00646834, which the rule of 72 approximates as 72 ÷ 8 = 9.
Why is the log of a number between 0 and 1 negative?
To get a value smaller than 1 from a base above 1, you need a negative power. For example, log base 10 of 0.001 is −3 because 10 to the power −3 is 0.001.

Related guides

Related tools

People also used

Embed this tool on your site

Paste it into any blog or website. Free, with a credit link.