Log (Logarithm) Calculator
Need logs in any base? Enter x and base b to calculate log base b of x, with clear numeric output for algebra and formulas.
Enter the Details
Result will appear here...
What this calculator does
So, you want the logarithm of a number to a base of your choosing. This tool takes a number and a base, and returns the logarithm of that number in that base, to five decimal places.
There are two inputs: the number x, and the base b. That freedom to set the base yourself is what sets this tool apart from the fixed-base ones for base 2, base 10, and base e.
How to use it
- Enter the number (x) you want the logarithm of.
- Enter the base (b).
- Press Calculate.
For a logarithm to make sense, the number should be positive and the base should be positive and not equal to 1.
What a logarithm is
A logarithm answers one question: what power? The logarithm of a number x to base b is the power you have to raise b to in order to get x. So the log base 2 of 8 is 3, because 2 raised to the power 3 is 8. Written as an equation, if b to the power y equals x, then the log base b of x is y. That is the whole idea. A logarithm is simply an exponent, pulled out and looked at on its own, which makes it the exact reverse of raising a number to a power.
Any base you like
The base is the number doing the multiplying. Base 2 counts in doublings, base 10 counts in tens, base e counts in the natural way that continuous growth prefers. But nothing stops you using base 3, or base 7, or base 1.5. This tool lets you set whatever base your problem calls for, and it will find the matching power. The three dedicated tools on this site cover the three most common bases; this one covers all the rest, and those three too if you enter their base by hand.
How it handles any base: change of base
Behind the scenes, the tool uses a neat identity called the change of base formula. It turns out you can find a logarithm in any base by taking two logarithms in some other fixed base and dividing one by the other. This tool computes the natural logarithm of your number, the natural logarithm of your base, and divides the first by the second:
logb(x) = ln(x) / ln(b)
That is why a single built-in logarithm is enough to reach every base. The division rescales the natural log into the base you asked for, and the answer is exact regardless of which base you chose.
A worked example
Enter a number of 81 and a base of 3. The tool asks, in effect, what power of 3 gives 81. Since 3 times 3 times 3 times 3 is 81, the answer is 4. Internally it divides the natural log of 81 by the natural log of 3, which comes out to 4. Try a number of 8 and a base of 2 and you get 3, because 2 cubed is 8.
Why logarithms are useful
Logarithms have two great powers. First, they turn multiplication into addition: adding the logs of two numbers matches multiplying the numbers themselves, which is the trick that once made slide rules and log tables so valuable for hard sums. Second, they compress enormous ranges into manageable ones, which is why so many scales, from earthquake strength to sound loudness to acidity, are logarithmic. To go the other way, from a logarithm back to the original number, use the antilog calculator, which raises the base to the power.
Questions people ask
What does a logarithm actually give me?
The power you must raise the base to in order to reach your number. If b to the power y equals x, the log base b of x is y.
What base should I use?
Whatever your problem calls for. Base 2 for doubling, base 10 for orders of magnitude, base e for growth, or any other positive base other than 1.
How can it do any base?
By the change of base formula: it divides the natural log of your number by the natural log of your base, which rescales the result into that base.
Why must the number be positive?
Because a positive base raised to any power is always positive, so no power of it can produce zero or a negative number. Logarithms are only defined for positive inputs.
How do I reverse a logarithm?
Take the antilogarithm, which raises the base to the power. The antilog calculator does this.
References
On logarithms to any base. A logarithm is the inverse of raising a base to a power, and any base can be reached from another by the change of base formula.
- Eric W. Weisstein, "Logarithm," from MathWorld, a Wolfram resource, on the logarithm as the inverse function of raising a base to a power.
- "John Napier," MacTutor History of Mathematics, on Napier's invention of logarithms to simplify calculation.
Okan Atalay is a results driven senior operations manager and a graduate of Industrial Engineering from Bilkent University. With over 22 years of experience in textile manufacturing and integrated operations, he has led large scale business process improvements and strategic planning initiatives. Currently, he serves as a top mathematics expert for a global ed tech platform, where he applies his analytical expertise to solve complex mathematical problems. At Eon Tools, he reviews converter and maths tools.