Log Calculator · Practical guide
How to Calculate a Logarithm With Any Base
One formula handles every base: divide the natural log of the number by the natural log of the base.
At a glance
Use the Change of Base Formula
To calculate a logarithm in any base, use log_b(x) = ln(x) / ln(b). You can swap in log10 for ln — the answer is identical. For example, log base 5 of 125 = 3: ln(125) / ln(5) = 4.828314 / 1.609438 = 3, which is correct because 5^3 = 125. Enter the number and base above and the calculator shows this exact formula with your values filled in.
Interactive tool
Log Calculator
Enter your own values, then compare the result with the examples below.
Results
Another Worked Example: log3(10)
log3(10) = ln(10) / ln(3) = 2.302585 / 1.098612 = 2.095903. Verify with the inverse: 3^2.095903 = 10. The inverse row of the calculator performs this check for you on every calculation.
Rules for a Valid Base
- The base must be positive — negative bases do not give real-valued logarithms.
- The base cannot equal 1, because 1 raised to any power is still 1.
- The number x must be positive for real results.
- Bases between 0 and 1 are allowed and flip the sign pattern: log base 0.5 of 8 = -3, because 0.5^-3 = 8.
Common Bases at a Glance
Base 10 (common log) suits orders of magnitude, base e (natural log) suits continuous growth, and base 2 suits computing and binary problems. Every other base — 3, 5, 0.5, even decimals like 2.5 — works through the same change of base division.
Frequently Asked Questions
What is the change of base formula?
log_b(x) = log(x) / log(b), using either natural log or common log. It converts any base into a single division.
Why can't the base be 1?
Because 1 raised to any power is always 1, so no exponent can produce any other number. A base of 1 makes the logarithm undefined.
Can the base be a decimal?
Yes. Decimal bases like 2.5 or 0.5 work fine as long as they are positive and not equal to 1.
How do I verify a logarithm answer?
Raise the base to your result: if log_b(x) = y, then b^y must equal x. The calculator shows this inverse automatically.