Home › All Tools ›

Logarithm Calculator

Use Logarithm Calculator online for free at FreeToolZones — no sign-up, no watermark.

Loading tool...

The Logarithm Calculator on FreeToolZones finds logarithms in any base, and shows the base 10, natural, and base 2 logarithms of your number side by side, together with a check that raising the base to the result returns the original number. Logarithms answer the question: to what power must the base be raised to get this number? That question appears in earthquake magnitudes, sound levels, acidity, compound growth, computer science, and any scale where quantities span many orders of magnitude. This tool makes the answer immediate, while the side-by-side display helps you move fluently between the three bases used most often.

If you know that 10 squared is 100, you already know that the base 10 logarithm of 100 is 2. If you know that 2 cubed is 8, you know that the base 2 logarithm of 8 is 3. A logarithm is an exponent, nothing more mysterious than that, and the Logarithm Calculator simply finds the exponent for numbers where the answer is not a whole number, such as the base 10 logarithm of 2, which is about 0.30103. The verification line, which shows the base raised to the computed logarithm, turns the abstract definition into a visible check you can trust.

What Is the Logarithm Calculator?

The Logarithm Calculator takes a number x and a base b, and returns the logarithm of x to base b, written log base b of x. It computes the result with the change-of-base formula, dividing the natural logarithm of x by the natural logarithm of b. Alongside the requested result, it always shows three standard logarithms of the same x: log base 10, often written log10; the natural logarithm, written ln, which uses base e; and log base 2, written log2. That trio covers the bases used in science, mathematics, engineering, and computing, so you rarely need to recalculate for a different base.

The tool enforces the mathematical domain of logarithms. The number x must be greater than zero, because no real power of a positive base is zero or negative. The base b must be positive and not equal to 1, because 1 raised to any power is 1, and a negative or zero base does not give a well-defined real logarithm for all positive x. When either rule is broken, the tool shows a specific error message explaining the requirement, rather than returning a meaningless number or a blank result.

Three shortcut buttons set the base quickly: Base 10, Base e, and Base 2. The Base e button enters the full value of Euler’s number, about 2.718281828459045, rather than a rounded 2.72, so the result matches the natural logarithm. The verification line below the results shows the base raised to the computed logarithm, which should equal x within rounding. For example, with x as 100 and base 10, the result is 2, and the check shows 10 to the power of 2 equals 100.

How to Use the Logarithm Calculator

  1. Enter the number x in the Number (x) field. The tool starts with 100 as an example. The number must be greater than zero.
  2. Enter the base b in the Base (b) field. The tool starts with 10 as an example. The base must be positive and not equal to 1.
  3. Optionally press Base 10, Base e, or Base 2 to set a standard base instantly instead of typing it.
  4. Press Calculate, or change either field, because the results update automatically as you type.
  5. Read the large display, which states the logarithm in words and gives the value to ten decimal places, then check the three summary values for log10, ln, and log2, and the verification line below them.

With the default values, the large display reads that the log base 10 of 100 is 2. The summaries show log10 as 2, ln as about 4.605170186, and log2 as about 6.64385619. The verification line shows 10 to the power of 2 equals 100. Change the base to 2 without changing x to see the main result become about 6.64385619, matching the log2 summary. Change x to 8 with base 2 to get exactly 3, because 2 cubed is 8. These round-number checks confirm that the tool is behaving as the definition requires.

Try a non-integer result to see the tool’s real value: enter x as 2 and base as 10. The result is about 0.30103, which means 10 to the power of 0.30103 is 2. Enter x as 1000 and base as 10 to get 3. Enter x as 1 with any valid base to get 0, because any base to the power of 0 is 1. Enter x as 0.01 with base 10 to get minus 2, because 10 to the power of minus 2 is 0.01. Logarithms of numbers between 0 and 1 are negative, logarithms of 1 are zero, and logarithms of numbers greater than 1 are positive, for any base greater than 1.

Key Features of the Logarithm Calculator

  • Any base: Enter any positive base other than 1, including fractional bases, and get the logarithm to that base.
  • Three standard logarithms at once: Every calculation shows log10, ln, and log2 of the same number, so you can compare bases without re-entering anything.
  • Built-in verification: The check line raises the base to the result and shows that it returns x, making the definition visible.
  • Quick base buttons: Base 10, Base e, and Base 2 buttons set the most common bases with one press, with e entered at full precision.
  • Live updates: Results recalculate as you type, which makes it easy to explore how the logarithm changes as x or the base changes.
  • Domain validation: Non-positive numbers and invalid bases produce clear explanations of the mathematical requirements.
  • High precision display: Results are shown to ten decimal places, which is enough for most scientific and engineering checks.

The change-of-base relationship is worth noting because it explains why the three summaries are always consistent. The logarithm of x to any base b equals the natural logarithm of x divided by the natural logarithm of b. It also equals log10 of x divided by log10 of b, and log2 of x divided by log2 of b. You can verify this with the tool: for x as 100, ln is about 4.605170186 and ln of 10 is about 2.302585093, and their ratio is 2, which matches log10 of 100. The tool performs exactly this kind of division internally.

Practical Use Cases and Worked Examples

Example 1: Powers of ten and orders of magnitude

Enter x as 1000000 with base 10. The result is 6, because 10 to the power of 6 is one million. The logarithm counts the zeros: each additional factor of 10 adds 1 to the base 10 logarithm. Enter x as 500 with base 10 to get about 2.69897, which is between 2 and 3, as expected, since 500 is between 100 and 1000. This is how scientists compare quantities that differ by huge factors: the logarithm turns multiplication into addition, so a difference of 1 in the logarithm means a factor of 10 in the original number.

Example 2: Doubling time and growth

How long does money take to double at 5 percent growth per period? The answer is ln(2) divided by ln(1.05). Use the tool to find ln(2), which is about 0.6931471806, by entering x as 2 and reading the ln summary. Then find ln(1.05), which is about 0.04879016417, by entering x as 1.05. Dividing gives about 14.206699. You can also compute the logarithm directly: enter x as 2 and base as 1.05 to get about 14.206699 in one step, because the base 1.05 logarithm of 2 is exactly the number of periods needed to double. The verification line shows 1.05 to that power equals 2.

Example 3: Binary logarithms in computing

Enter x as 1024 with base 2 to get 10, because 2 to the power of 10 is 1024. Enter x as 256 with base 2 to get 8. Enter x as 1000 with base 2 to get about 9.965784285, which tells you that 1000 is just below 2 to the power of 10. Binary logarithms answer questions such as how many bits are needed to represent a range of values, how many times a quantity can be halved, and how deep a balanced binary search will go. The log2 summary makes these answers available for any x without changing the base.

Example 4: Logarithms with bases other than 10, e, and 2

Enter x as 125 with base 5 to get 3, because 5 cubed is 125. Enter x as 81 with base 3 to get 4, because 3 to the power of 4 is 81. Enter x as 64 with base 4 to get 3, because 4 cubed is 64. For a fractional base, enter x as 8 with base 0.5. The result is minus 3, because 0.5 to the power of minus 3 is 8. Bases between 0 and 1 reverse the usual order: larger x values give smaller, more negative logarithms, which the tool handles correctly as long as the base is positive and not 1.

Example 5: pH, decibels, and logarithmic scales

Many real scales are logarithmic. A pH value is the negative base 10 logarithm of the hydrogen ion concentration, so a solution with concentration 0.001 has a pH of 3, because log10 of 0.001 is minus 3. A decibel difference of 10 corresponds to a factor of 10 in power, because the decibel scale uses 10 times the base 10 logarithm of a power ratio. If a sound is 100 times as powerful, the difference is 10 times log10 of 100, which is 10 times 2, which is 20 decibels. The tool gives you the logarithm; multiplying by the scale factor for your field gives the scale reading.

Example 6: Checking inverse operations

Logarithms and exponentials undo each other. Enter x as 100 and base as 10 to get 2, then use the Exponent Calculator to check that 10 to the power of 2 is 100. Enter x as 20 and base as e, using the Base e button, to get about 2.995732274. Raising e to that power returns 20. This inverse relationship is the basis for solving exponential equations: if 3 to the power of y equals 50, then y is the base 3 logarithm of 50, which is about 3.560876, and you can find it by entering x as 50 and base as 3.

Tips and Best Practices

First, decide which base your problem uses before you read the answer. In school mathematics, log without a base usually means base 10. In calculus and science, log often means the natural logarithm. In computing, log often means base 2. The tool shows all three, so check the label, not just the number. Second, remember the three anchor values: the logarithm of 1 is always 0, the logarithm of the base itself is always 1, and the logarithm of a number between 0 and 1 is negative for bases greater than 1. If your answer violates these anchors, check your inputs.

Third, use the verification line. If the base raised to the result does not return x, within rounding, something is wrong with the inputs or the reading of the output. Fourth, for growth and decay problems, set the base to the growth factor, such as 1.05 for 5 percent growth, and x to the total growth factor, such as 2 for doubling, to get the number of periods directly. Fifth, keep enough decimal places for your purpose: ten places is generous, but if you copy the result into a further calculation, copy the full displayed value rather than a rounded 2 or 3 decimal version. Finally, never take the logarithm of zero or a negative number in this tool: the error message is telling you the operation has no real answer, not that the tool is broken.

Limitations

The Logarithm Calculator computes real logarithms only. The number must be greater than zero, and the base must be positive and not equal to 1. Complex logarithms are not supported. Results are floating-point approximations shown to ten decimal places, so values that should be exact integers, such as log10 of 100, may show tiny rounding differences in the final digits for less round inputs, and the verification line may differ from x in its last displayed digits.

The tool computes one logarithm at a time and does not solve logarithmic equations, expand logarithmic expressions, or graph logarithmic functions. The Base e button enters e at the precision of the browser’s number representation, which is more than enough for ten-decimal output but is still an approximation of the irrational constant e. The tool does not accept expressions as input: enter a single number for x and a single number for the base.

Frequently Asked Questions

What is a logarithm?

A logarithm is an exponent. The base 10 logarithm of 100 is 2 because 10 to the power of 2 is 100. The base 2 logarithm of 8 is 3 because 2 cubed is 8.

What is the difference between log, ln, and log2?

They differ only in the base. Log means base 10, ln means base e, about 2.718282, and log2 means base 2. The tool shows all three for every number you enter.

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

Because no real power of a positive base equals zero or a negative number. The logarithm is only defined for positive numbers in real mathematics, and the tool enforces that rule.

Why must the base not be 1?

Because 1 raised to any power is 1, so there is no unique exponent that produces a given number. A base of 1 cannot define a logarithm.

How do I find the base 5 logarithm of 125?

Enter 125 as the number and 5 as the base. The answer is 3, because 5 cubed is 125. The verification line shows 5 to the power of 3 equals 125.

What does a negative logarithm mean?

For a base greater than 1, a negative logarithm means the number is between 0 and 1. For example, log10 of 0.01 is minus 2, because 10 to the power of minus 2 is 0.01.

Related Tools

Continue with the Exponent Calculator for the inverse operation of raising a base to a power, the Scientific Calculator for logarithms inside longer expressions, the Number Rounding Tool to round logarithmic results, the Compound Interest Calculator for growth problems that logarithms help solve, and the CAGR Calculator for average growth rates. You can also return to the FreeToolZones home page to browse the full tool collection.

Browse More Tools