A log calculator finds the logarithm of a positive number in any base, the power you must raise the base to in order to get the number. log10(100) = 2 and log2(8) = 3.
On this page

How to use the log calculator
- Enter a positive value.
- Enter the base, such as 10, 2 or 2.718281828 for e.
- Read the logarithm; exact powers such as log10(1,000) show as whole numbers, with no floating-point error.
How the log calculator works
A logarithm answers the question “what power of the base gives this value?” If by = x, then logb(x) = y. The log calculator works for any positive base other than 1 by using the change-of-base rule:
- logb(x) = ln(x) ÷ ln(b)
- The value x must be greater than 0
- The base b must be greater than 0 and not equal to 1
Results are shown to 8 decimal places.
Log calculator worked example
log10(100) = 2 because 10² = 100. log2(8) = 3 because 2³ = 8. For a value that is not an exact power, such as log10(50), the log calculator gives 1.69897000, since 101.69897 ≈ 50. For the natural log, enter e ≈ 2.718281828 as the base.
| Value | Base | Logarithm |
|---|---|---|
| 100 | 10 | 2 |
| 1,000 | 10 | 3 |
| 50 | 10 | 1.69897 |
| 0.01 | 10 | −2 |
| 8 | 2 | 3 |
| 1,024 | 2 | 10 |
| 81 | 3 | 4 |
| 20 | e | 2.99573 |
Logarithm rules
- Product: log(xy) = log x + log y
- Quotient: log(x ÷ y) = log x − log y
- Power: log(xn) = n log x
- logb(1) = 0 and logb(b) = 1
These rules, listed in the NIST Digital Library of Mathematical Functions, let you split hard problems into simple ones. For example, log10(5,000) = log10(5) + log10(1,000) = 0.69897 + 3 = 3.69897.
Common bases
Base 10 is the common logarithm, used in pH, decibels and the Richter-style magnitude scales. Base e is the natural logarithm, written ln, which appears in growth, decay and calculus. Base 2 is used in computing: log2(1,024) = 10 tells you that 1,024 needs 10 bits. The log calculator handles all three, plus any other valid base.
Why negative values fail
No positive base raised to a real power gives zero or a negative number, so the logarithm of 0 or a negative value is undefined in real numbers. Values between 0 and 1 have negative logs: log10(0.01) = −2. If the log calculator shows an error, check that the value is positive and the base is not 1.
Working logs without a calculator
Before electronic calculators, people used printed log tables and slide rules, which turn multiplication into addition. To multiply two numbers you added their logs and looked up the result. You can still estimate logs in your head with a few anchors: log10(2) ≈ 0.301, log10(3) ≈ 0.477 and log10(7) ≈ 0.845. Then log10(6) = 0.301 + 0.477 = 0.778, and log10(200) = 0.301 + 2 = 2.301.
The number of digits in a whole number is one more than the whole-number part of its base-10 log, so a number with a log of 5.4 has six digits. In base 2, the log tells you how many times you can halve a number before it reaches 1, which is why binary search through a million items takes only about 20 steps.
Where logarithms appear
Logs turn exponential growth into straight lines, which is why charts of populations, prices and virus cases often use a log scale. In finance, the time to double money at rate r is ln(2) ÷ ln(1 + r), which gives the rule of 72. In chemistry, pH is the negative base-10 log of hydrogen ion concentration. Sound level in decibels is 10 times the base-10 log of a power ratio. Each of these is a quick job for the log calculator.
Related converters and calculators
Related calculators:
- Exponent calculator: powers
- Scientific calculator: functions
- Scientific notation calculator: powers of 10
Sources
NIST Digital Library of Mathematical Functions, §4.2: Logarithms.
Formula and method
log_b(x) = ln(x) ÷ ln(b); base 10 and 2 use exact log10/log2; result rounded to 12 significant digits and snapped to integers.
Change-of-base formula without floating-point artifacts such as 2.9999999999999996. x > 0; b > 0 and b ≠ 1.
Questions about this calculator
What is log base 10 of 1,000?
3.
How do I get the natural log?
Use e ≈ 2.718281828 as the base.
Can I take the log of a negative number?
No, it is undefined in real numbers.
Why can’t the base be 1?
1 raised to any power is 1, so no unique answer exists.
What is the change-of-base rule?
log_b(x) = ln(x) ÷ ln(b).
Check the assumptions and units before relying on a result. Financial, tax and health estimates do not replace advice for your individual circumstances.
Report a calculation issue