Log Calculator
Enter a number and a base to get the logarithm. The natural, base-10 and base-2 logs are shown too.
Be the first to rate this tool
The formula
log_b(x) = ln(x) / ln(b). If b^y = x then y = log_b(x).
What a logarithm is
A logarithm answers the question "what power do I raise the base to in order to get this number?". Since 10^3 = 1,000, the log base 10 of 1,000 is 3. Since 2^10 = 1,024, the log base 2 of 1,024 is 10.
The three you will meet most
- log (base 10): used for decibels, pH and the Richter scale.
- ln (base e, about 2.718): the natural log, used in growth, decay and calculus.
- log2: used in computing, for example how many bits you need to store a number.
Useful rules
- log(a x b) = log(a) + log(b)
- log(a / b) = log(a) - log(b)
- log(a^n) = n x log(a)
- Change of base: log_b(x) = log(x) / log(b)
Why you cannot take the log of zero or a negative
No power of a positive base ever produces zero or a negative number, so those logs do not exist in the real numbers. The calculator shows a message in those cases. A base of 1 is also ruled out because 1 to any power is just 1.
Examples to check
Type these into the calculator above to see how it behaves. Every result below was produced by the same calculator code that runs on this page.
| What you enter | What you get |
|---|---|
| Number (x): 1000; Base (b): 10 | log base 10 of 1,000: 3 |
| Number (x): 1024; Base (b): 2 | log base 2 of 1,024: 10 |
| Number (x): 100; Base (b): 5 | log base 5 of 100: 2.8613531161 |
| Number (x): 2.718281828; Base (b): 10 | log base 10 of 2.718282: 0.4342944818 |
Log Calculator: frequently asked questions
What is the difference between log and ln?
On most calculators log means base 10 and ln means base e. In some maths and computer science texts, log on its own means ln or log base 2, so check the context.
How do I find how long it takes to double?
Use logs: time = ln(2) / ln(1 + rate). At 7% growth that is about 10.2 periods.
How accurate is this calculator?
It uses standard double-precision arithmetic, accurate to about 15 significant digits. Results are rounded only for display.
Is what I enter in this calculator saved or sent anywhere?
No. The calculation runs in your browser, so what you enter is not sent to our servers. We only count, anonymously, whether a tool ran successfully.
Is this calculator free to use?
Yes. It is free, needs no sign-up and has no usage limit.
Last reviewed: October 3, 2026