Logarithm calculator

Enter the number and the base: calculate the logarithm. For the natural log write e as the base.

What it is, without formulas

A logarithm answers a single question: how many times do I have to multiply the base by itself to reach this number? The logarithm to base 10 of 1000 is 3, because 10×10×10 makes 1000. The logarithm to base 2 of 1024 is 10, because doubling ten times from 1 gets you to 1024. It's the inverse of raising to a power, exactly as division is the inverse of multiplication.

When the logarithm is a whole number or a fraction with a denominator up to 12, here it comes out exact: the base 8 logarithm of 2 is 1/3, and the page checks it by redoing the power with whole numbers. In the other cases, like the base 10 logarithm of 2, the value is rounded to twelve significant digits, and the page says so.

The three bases you meet

Base 10 is the one behind decibels, pH and the Richter scale: they're all scales where going up by one means multiplying by ten, which is why a magnitude 6 earthquake isn't «a bit stronger» than a magnitude 5 one.

Base 2 is the one computing uses: it says how many bits you need to tell a given number of cases apart (with 10 bits you count 1024 values) and how many times something can be halved. Base e ≈ 2.718 is the natural logarithm, the one that turns up by itself in every growth and decay formula; to use it here just write the letter e in the base field, which is more precise than any number typed by hand.

What it's for in real life

For the question «how many years until it doubles?». A sum earning 5% a year doubles in log(2) ÷ log(1.05) years, a little over fourteen. The same arithmetic works for anything growing by a fixed percentage: a subscription going up, a debt with interest, the number of subscribers to a channel.

When the logarithm doesn't exist

It doesn't exist for zero and negative numbers: no exponent can take a positive base to a negative number or to zero. And there's no base 1: one multiplied by itself is always one, so you get nowhere. In all three cases a message here says so, rather than showing a meaningless number.

Nearby tools

The inverse operation is Power calculator. For complete expressions there is Scientific calculator, and to see how much a sum really grows over the years Compound interest.

Related tools