Log Calculator
Evaluate logb(x) in any base — with one-tap buttons for ln, log₁₀, and log₂ — or flip the equation around to solve for the number x or the base b. Every answer comes with change-of-base working and a check line.
Logs are exponents in reverse
logb(x) asks one question: b to what power equals x? Since 2³ = 8, log₂(8) = 3. The three famous bases each own a field: natural log (base e) rules calculus and continuous growth, base 10 runs decibels, pH, and earthquake magnitudes, and base 2 counts the doublings behind bits and binary search. Any other base is reached through change of base: logb(x) = ln x ÷ ln b, which is literally how this page (and your calculator) computes it.
How it’s calculated
y = ln(x) ÷ ln(b) (change of base). Solving for the number inverts to x = bʲ; solving for the base gives b = x^(1/y). Domain rules enforced: x > 0, b > 0 and b ≠ 1, and y ≠ 0 when recovering a base. Results display to 10 significant digits.
A base between 0 and 1 is legal but makes the log decrease as x grows — expect negative-looking behavior there.
Worked example
log₂(8): change of base gives ln 8 ÷ ln 2 = 2.0794 ÷ 0.6931 = 3, and the check confirms 2³ = 8. More: log₁₀(1,000) = 3, ln(e²) = 2, and log₅(100) = ln 100 ÷ ln 5 ≈ 2.861353. Backwards: if logᵇ(81) = 4, then b = 81^(1/4) = 3.
Common mistakes
- Mixing up ln and log — on this page and most hand calculators, log alone means base 10.
- Splitting log(a + b) into log a + log b; only log(a×b) = log a + log b works.
- Taking the log of a negative number or zero — undefined for real numbers.
- Forgetting b = 1 is banned: 1 to any power is 1, so it can never reach x.
Where it is used
- Solving exponential equations: doubling times, decay, and compound growth.
- Computer science: algorithm complexity (log₂ n) and information in bits.
- Science scales: pH, decibels, and earthquake magnitude are all base-10 logs.
- Finance: years to reach a target = log(target/start) ÷ log(1 + rate).
Frequently asked questions
What does a logarithm actually mean?
log base b of x answers “b to what power gives x?”. Because 2³ = 8, log₂(8) = 3. Logs undo exponents the way division undoes multiplication, which is why they solve any equation with an unknown in the exponent.
What is the difference between ln, log, and log2?
ln is the natural log, base e ≈ 2.71828, used in calculus and continuous growth. log usually means base 10 in school and engineering (decibels, pH, Richter). log₂ is base 2, the language of computing — bits, binary search, and doubling times. The quick buttons switch between them.
What is the change-of-base formula?
log_b(x) = ln(x) ÷ ln(b) — any log can be computed from logs in another base. That is how calculators evaluate log base 5 of 100: ln 100 ÷ ln 5 ≈ 4.6052 ÷ 1.6094 ≈ 2.8614. The steps line shows this division for your numbers.
Why can’t I take the log of zero or a negative number?
A positive base raised to any real power stays positive, so no exponent can produce 0 or a negative value — the log is undefined there (log of values between 0 and 1 is simply negative, which is fine). The base itself must be positive and not equal to 1.
How do I solve for an unknown base?
If log_b(x) = y, then b = x^(1/y). For log_b(81) = 4, the base is 81^(1/4) = 3. Pick “Solve for base” mode and the calculator inverts the equation this way, then verifies by raising the base back.