Log Calculator
Compute the logarithm of any number in base 10, base 2, base e, or a custom base, using the change of base formula.
Log Calculator — input your values
What does this math calculator do?
The log calculator computes log_b(x) for base 10, base 2, base e (the natural log), or any custom base you choose. It validates the domain first — x must be positive, the base must be positive and not equal to 1 — and then applies the change of base formula.
The working shows the change of base identity log_b(x) = ln(x)/ln(b) with the actual numbers substituted, so you can see exactly how a calculator arrives at the answer. It also reports the number's logs in the three standard bases and checks the result by raising the base back to the answer.
Formula and variables
The change of base formula works because the logarithm is the inverse of exponentiation: b^log_b(x) = x.
| Symbol | Meaning |
|---|---|
| b | The logarithm base (b > 0, b ≠ 1) |
| x | The number (x > 0) |
| ln | The natural logarithm, base e ≈ 2.71828 |
Worked example
A computer program's complexity is log₂(n). How many steps for n = 1024, and what is log₁₀(1000)?
- log₂(1024) = 10 because 2^10 = 1024.
- Using the formula: ln(1024) ÷ ln(2) = 6.93147 ÷ 0.69315 = 10.
- log₁₀(1000) = 3 because 10³ = 1000.
Answer: log₂(1024) = 10 and log₁₀(1000) = 3.
Tips and common mistakes
Tips
- Memorize the power-of-ten logs: log₁₀(1) = 0, log₁₀(10) = 1, log₁₀(100) = 2, and so on.
- Use log₂ in computer science contexts: log₂(1024) = 10 because 2^10 = 1024.
- The natural log ln(x) is the log with base e; it is the default in most math software and calculus.
- To check any log, raise the base to the answer — you should get x back.
Common mistakes to avoid
- Taking the log of zero or a negative number, which is undefined.
- Using a base of 1, which makes every power equal to 1 and the log undefined.
- Forgetting that log(x) grows much more slowly than x — logs compress large ranges, which is why they are used on graphs.
Log Calculator — frequently asked questions
What is a logarithm?
The logarithm log_b(x) answers 'to what power must b be raised to get x?'. For example, log₁₀(1000) = 3 because 10³ = 1000.
What is the difference between log and ln?
log usually means base 10, while ln is the natural logarithm with base e (about 2.71828). They are related by the change of base formula.
Why must x be positive?
Because logarithms are the inverse of exponentiation, and b^y is always positive for a positive base b — so no exponent produces zero or a negative number.
What is the change of base formula?
log_b(x) = ln(x) ÷ ln(b). It lets you compute a logarithm in any base using natural logs (or any other base you can compute).
Why can't the base be 1?
Because 1 raised to any power is 1, so the question '1^y = x' has no unique answer unless x = 1, in which case every y works.
Where are logarithms used in real life?
In the pH scale, decibels, earthquake magnitudes (Richter), algorithmic complexity (log₂), compound interest analysis, and scientific graphs that compress huge ranges.