Logarithm Calculator

A logarithm answers one question: what power do you raise a base to in order to get a particular number? Take 8 with a base of 2, the answer is 3, because 23=82^3 = 8. The same trick works for base 10 (the common log), base ee (the natural log you see all over calculus), or any other positive base except 1.

What a logarithm actually is

The notation logb(x)=y\log_b(x) = y is shorthand for by=xb^y = x. So log10(1000)=3\log_{10}(1000) = 3 because 103=100010^3 = 1000, and log2(32)=5\log_2(32) = 5 because 25=322^5 = 32. Three bases show up often enough to get nicknames: base 10 is the common log (often written just "log"), base e2.71828e \approx 2.71828 is the natural log (written "ln"), and base 2 is the binary log that shows up everywhere in computer science.

For any other base, the change-of-base identity logb(x)=log(x)log(b)\log_b(x) = \frac{\log(x)}{\log(b)} gets you there. That is the identity this calculator uses internally, which is why you can pick any positive base you like (apart from 1).

Using the calculator

Type the number you want to take the log of and pick a base. The result fills in as soon as both inputs have values. For a natural log, type e as the base.

It also runs in reverse. If you already know the log result and either the number or the base, fill in those two and the missing one is solved for you. Handy when you need to crack something like 2x=642^x = 64, set base to 2, log to 6, and read off the number, which is 64.

Where logarithms show up

A lot more places than most of us remember from high school. pH measures hydrogen ion concentration on a log scale, so a pH of 4 is ten times more acidic than a pH of 5, not just "a bit" more. Decibels measure sound intensity on a log scale too, which is why the jump from 60 dB to 90 dB sounds dramatically louder than 60 dB to 70 dB. The Richter scale is logarithmic in much the same way, a magnitude 7 quake releases roughly 32 times the energy of a magnitude 6.

Finance uses logs to answer doubling-time questions. At 7% annual return, an investment doubles in about log(2)/log(1.07)10.2\log(2) / \log(1.07) \approx 10.2 years. In computer science, binary search runs in O(logn)O(\log n) time because each step halves the search space. And in statistics, a log transform pulls long-tailed distributions back toward something more symmetric, which makes regression and plotting behave.

A few things worth knowing

Logarithms are only defined for positive numbers. log(0) blows up to negative infinity, and the log of a negative number is not a real value (it exists in the complex plane, but that is a different story). The base has to be positive as well, and it cannot equal 1, since 1 raised to any power is still 1, there is no unique answer to solve for. And for any valid base, log(1) is always 0, because anything to the zero power equals 1.

FAQ

What is the difference between log and ln?

In engineering and on most calculators, "log" with no subscript means base 10, and "ln" specifically means base ee. In pure math papers, "log" sometimes means the natural log instead, context matters. With this calculator there is no guessing: set the base explicitly to whichever one you need.

Can I take the log of a negative number?

Not in the real numbers. The function only returns real values for positive inputs. Complex logarithms do exist and handle negatives, but they live in a different number system.

Why can the base not be 1?

Because 1 raised to anything is still 1, so the equation 1y=x1^y = x can never produce any x other than 1. There is no unique y to solve for, so the function is undefined when the base is 1.

What does log(1) equal?

Zero, no matter the base. Any positive number raised to the 0 power equals 1, so the log of 1 always comes back as 0.

Author

hexacalculator design team

Our team blends expertise in mathematics, finance, engineering, physics, and statistics to create advanced, user-friendly calculators. We ensure accuracy, robustness, and simplicity, catering to professionals, students, and enthusiasts. Our diverse skills make complex calculations accessible and reliable for all users.