Skip to content

Logarithm Calculator

Calculate the logarithm of a positive number in any base, including base 10, base 2, the natural logarithm with base e and fractional bases such as 1/2. When the answer is a rational number, such as log base 4 of 8 = 3/2, the calculator finds the exact value and proves it with integer powers. Natural, common and binary logarithms are shown alongside, rounded with mathjs to your chosen precision. Useful for algebra, pH and computer science.

Reset

Frequently asked questions

What does a logarithm mean?

The logarithm of x to base b is the exponent you need to raise b to in order to get x. So log base 10 of 1000 is 3, because 10^3 = 1000. The check row of the result shows this power relation for your numbers.

How do I choose the base?

Type the base in the Base field: 10 by default, 2 for binary logarithms, e for the natural logarithm, or any positive number other than 1, including decimals and fractions such as 0.5 or 1/2. The number itself goes in the first field. Leave the base empty to use 10.

When is the result exact?

The tool tests whether the logarithm equals a fraction p/q with a denominator up to 12 and confirms it by checking that b^p equals x^q with exact integer arithmetic. log base 4 of 8 is reported as exactly 3/2 and log base 1/2 of 8 as exactly -3. Otherwise only the rounded decimal is shown.

Why must the number be positive?

No real power of a positive base produces zero or a negative number, so the logarithm of 0 or a negative value is not a real number. The tool reports an error for these inputs. Complex logarithms are available in the Scientific Calculator, where ln(-1) returns a complex value.

Why can the base not be 1?

Every power of 1 equals 1, so no exponent turns 1 into any other number, and the logarithm is undefined. Bases must also be positive. The tool explains this when the base is not valid.

What are ln, log10 and log2?

ln is the natural logarithm with base e, about 2.718, used in calculus and growth models. log10 is the common logarithm used for pH, decibels and orders of magnitude. log2 is the binary logarithm used for bits and algorithm complexity, and all three are shown for every number.

How is the logarithm in another base computed?

Base 10 and base 2 use dedicated functions for best accuracy, base e uses the natural logarithm, and any other base uses the change of base formula ln(x) / ln(b). The results are double precision numbers rounded to your chosen decimal places. Exact rational results are checked separately with integers.

Can the result be negative?

Yes, for a base greater than 1 the logarithm is negative when x is between 0 and 1, so log base 10 of 0.01 is -2. For a base between 0 and 1 the signs are reversed. The check row confirms the relation either way.

Can I enter very large or very small numbers?

Yes, use scientific notation such as 6.02e23 or 1e-9 within the limits of double precision numbers. Exact detection is skipped for numbers with more than 40 digits in numerator and denominator combined. The decimal result is still computed.

How do I compute an antilogarithm?

The antilogarithm is the power b^y, the reverse of a logarithm. Use the Scientific Calculator and type for example 10^2.5 or e^1.2. The check row here shows that power for the value you entered.

About OneClick Pro

OneClick Pro is a free collection of more than 150 web tools for everyday work: converting images and units, formatting and validating code, checking domains and SEO, and working with text, dates and numbers. Every tool runs without registration or subscription, and what you enter is only used to calculate your result and is never stored. Use it as a quick toolbox for one-off tasks, or bookmark the tools you rely on every day.