Logarithm Calculator

Log base b of x—
Natural log (ln x)—
Log base 10 of x—

How Logarithm Calculator is calculated: log base b of x is the power you raise b to in order to get x. log = ln(x) ÷ ln(b). The value must be greater than 0 and the base must be positive and not 1.

What is a logarithm?

A logarithm answers a simple question: to what power must I raise the base to get this number? The log base 10 of 100 is 2, because 10 raised to 2 is 100. The log base 2 of 8 is 3, because 2 raised to 3 is 8. The logarithm is the inverse of the power, the same way subtraction is the inverse of addition.

Logarithms turn multiplication into addition, which is why they were invented. Before electronic calculators, scientists used log tables to multiply large numbers by adding their logs instead. The idea survives today in every field where quantities span huge ranges, from earthquake magnitudes to sound levels to acidity.

This calculator takes a value and a base and gives you three answers: the log to your base, the natural log, and the log base 10. The default is the log base 10 of 100, which is 2, with a natural log of about 4.61 and a log base 10 of 2. The result updates live as you type.

How a logarithm calculator works

The calculator uses the change-of-base rule. Any log can be rewritten using natural logs: log base b of x equals ln(x) divided by ln(b). For the default, ln(100) is about 4.6052 and ln(10) is about 2.3026, and 4.6052 divided by 2.3026 is 2. That is the number shown on this page.

The natural log, ln, is the log to the base e, where e is about 2.71828. It is the log that calculus prefers, because the derivative of ln(x) is simply 1 divided by x. The log base 10 is the log people meet first in school, because it counts digits: log base 10 of 1,000 is 3, and log base 10 of 1,000,000 is 6.

Two inputs are forbidden and the calculator shows a dash for them. The value must be greater than 0, because no power of a positive base is zero or negative. The base must be positive and not equal to 1, because 1 raised to any power is 1, so a log base 1 has no answer.

The base, explained

The base is the number being raised to a power, and the choice of base changes the answer completely. Log base 10 of 100 is 2, log base 2 of 100 is about 6.64, and the natural log of 100 is about 4.61. All three describe the same number, 100, in different scales. The base is the scale.

Base 10 is the everyday base. It matches our decimal system, so log base 10 tells you the order of magnitude: a number with log base 10 of 3 has four digits, and one with log base 10 of 6 has seven. Base 2 is the computing base, because computers work in binary, and log base 2 of 1,024 is exactly 10.

Base e is the maths base. It appears wherever things grow or decay continuously — compound interest, radioactive decay, population growth — because e is the natural rate of continuous growth. If a problem mentions ln, it means base e, and this calculator shows ln alongside your chosen base so you can compare them directly.

A worked example: 100, 8 and 1

The default on this page is the value 100 with base 10. The log base 10 of 100 is 2, because 10 squared is 100. The natural log of 100 is 4.6052, shown as 4.61, and the log base 10 is 2. All three rows agree where they should: the log to base 10 and the log base 10 row are the same number.

Try the value 8 with base 2. The log base 2 of 8 is 3, because 2 cubed is 8. The natural log of 8 is 2.0794, shown as 2.08, and the log base 10 of 8 is 0.9031, shown as 0.90. Check the change of base: 2.0794 divided by ln(2), which is 0.6931, is exactly 3.

Try the value 1 with base 10. The log of 1 is 0 in every base, because any number raised to the power 0 is 1. The natural log of 1 is 0 and the log base 10 of 1 is 0. That is a useful check: if a calculator ever shows a log of 1 as anything but 0, something is wrong.

Where logarithms actually get used

Science runs on logs. The Richter scale for earthquakes is logarithmic: a magnitude 6 quake is ten times stronger than a magnitude 5 quake, not one unit stronger. The pH scale for acidity is logarithmic too: pH 3 is ten times more acidic than pH 4. Decibels for sound work the same way, which is why a 10-decibel rise sounds like a doubling.

Finance uses logs to compare growth over time. A stock that doubles in 10 years and one that triples in 15 years are hard to compare directly, but their log returns divide cleanly by the number of years. The compound interest calculator on this site handles the growth itself, while logs handle the comparison. A compound interest calculator pairs well with this tool for that reason.

Computing uses log base 2 everywhere. The height of a balanced search tree, the number of steps in a binary search, and the bits needed to store a number are all log base 2 values. Searching a million sorted records by binary search takes about 20 steps, because log base 2 of a million is about 19.93. A exponent calculator is the mirror image of this tool, since logs undo powers.

Logarithm calculator vs exponent calculator

A logarithm calculator and an exponent calculator are inverses of each other. The exponent calculator raises a base to a power: 10 to the power 2 is 100. The logarithm calculator asks the reverse question: 10 to what power gives 100? The answer is 2. One undoes the other, and checking a log by raising the base to the answer is the best way to verify it.

Use the logarithm calculator when the unknown is in the exponent. How many years until money doubles at 7% interest? That is a log question. Use the exponent calculator when the unknown is the result: what is 2 to the power 10? That is 1,024. The two tools answer different questions with the same pair of numbers.

The power calculator sits beside them, showing the squares, cubes and fourth powers of a single base in one view. If you need the log of a power, use this page; if you need the power itself, use one of those two. A scientific calculator does both jobs by hand, one button at a time. Logarithms and exponents are two sides of the same coin, and an exponential growth calculator shows the other side — starting from a value and a rate and growing it forward, period by period.

Common logarithm mistakes

The first mistake is taking the log of zero or a negative number. There is no answer: no power of 10 gives 0, and no power of 10 gives a negative number. The calculator shows a dash for those inputs, which is the correct response, not a bug.

The second mistake is using base 1. One raised to any power is 1, so log base 1 has no meaning, and the calculator refuses it. The third mistake is mixing up ln and log base 10. They differ by a factor of about 2.3026, so using one where the other belongs makes every answer wrong by that factor.

The fourth mistake is forgetting that log rules only apply to the same base. Log(a times b) equals log(a) plus log(b), but only when both logs share a base. Adding a base-10 log to a natural log gives a meaningless number. Convert first, then add.

How to use this logarithm calculator

Type the value into the first box and the base into the second. The default is 100 with base 10, giving a log of 2. The result updates live as you type, so you can try a base of 2 or e and watch all three rows change together.

Read the three rows together. The top row is the log to the base you chose. The second row is the natural log, and the third is the log base 10. If your base is 10, the first and third rows match. If your base is e, about 2.718, the first and second rows match.

Everything runs in your browser. No account, no upload, no data sent anywhere. Use it for homework, for pH and decibel problems, or alongside the exponent calculator to check a log by raising the base to the answer.

Frequently Asked Questions

Log base 10 of 100 is 2, because 10 raised to the power 2 is 100. The natural log of 100 is about 4.61. This calculator shows both, plus the log to any base you choose.

Ln is the natural logarithm, log to the base e, about 2.71828. Log on its own usually means log base 10 in school and log base e in university maths, so check the context. They differ by a factor of about 2.3026: ln(100) is 4.61 while log base 10 of 100 is 2.

No, not with real numbers. No power of a positive base is zero or negative, so log of zero or a negative number has no real answer. This calculator shows a dash for those inputs. The base must also be positive and not equal to 1.

Log base 2 of 8 is 3, because 2 raised to the power 3 is 8. Using the change-of-base rule, ln(8) divided by ln(2) is 2.0794 divided by 0.6931, which is 3. This calculator gives 3 directly.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.