Skip to content

Log Calculator (Any Base, ln, log₁₀, log₂)

Logarithm in base 10, e, 2 or any base you type, with the change-of-base working.

Inputs

log₅(36)
2.226566

Use this calculator on your own site

Free embed

  • Two lines of HTML, unlimited views
  • Shows a small CalculateEveryday bar, with a credit link under the calculator

What each Log input means

Value (x)
The number you want the logarithm of. It must be above 0; numbers between 0 and 1 have negative logarithms.
Log base
10 for the common log (the log key on most calculators), e for the natural log (ln), 2 for the binary log, or any other base typed in the next box.
Custom base
Used when the base is 'Any other base': any positive number except 1, decimals included, such as 3, 5 or 0.5.

Log formula

log_b(x) = ln(x) ÷ ln(b) · meaning: log_b(x) = y exactly when b^y = x

log⁡bx=ln⁡xln⁡blog⁡bx=y  ⟺  by=x\log_b x = \frac{\ln x}{\ln b} \qquad \log_b x = y \iff b^{y} = x

A logarithm answers one question: to what power must the base be raised to get this number? log₁₀(1000) is 3 because 10³ = 1000, and log₂(8) is 3 because 2³ = 8. Calculators only have two logarithm keys, ln (base e) and log (base 10), so any other base goes through the change-of-base formula: divide the natural log of the number by the natural log of the base. The page shows that division, the answer in base 10, base e and base 2 side by side, and a check that raises the base to the result and gets the number back. Whole-number answers are shown exactly rather than as 2.9999999, and a base between 0 and 1 is allowed — it just makes the logarithm of numbers above 1 negative.

Log worked example

log₅(36): no calculator key does base 5, so use change of base. ln(36) = 3.583519 and ln(5) = 1.609438, and 3.583519 ÷ 1.609438 = 2.226566. Check: 5 to the power 2.226566 is 36. The same figure comes from base-10 logs, log(36) ÷ log(5) = 1.556303 ÷ 0.698970, which is the OpenStax worked example rounded to 2.2266.

More Log examples

log₁₀(0.001) = −3, because 10⁻³ = 0.001. pH works this way: a hydrogen-ion concentration of 0.001 mol/L has pH −log₁₀(0.001) = 3.

How many bits does it take to count to a million? log₂(1,000,000) = 19.931569, so 20 bits are needed: 2²⁰ = 1,048,576 is the first power of 2 past a million.

Where the Log calculator can give the wrong answer

  • The number must be positive. log(0) and log of a negative number are not real numbers, so the page refuses them instead of showing NaN — though the logarithm of a number between 0 and 1 is fine, it is just negative: log₁₀(0.05) = −1.30103.
  • The base must be positive and not 1: 1 raised to any power is 1, so log base 1 has no answer. A base between 0 and 1 works and gives negative logs for numbers above 1: log₀.₅(8) = −3 because 0.5⁻³ = 8.
  • Results are shown to six decimal places. A logarithm that should be a whole number is snapped to it when the base's power really is the number; other answers are decimals rounded at the sixth place, so the check line can differ from the input by a unit in the last place.
  • The natural log row is base e = 2.718281828…, not 'e' in the sense of the exponent key. Choosing base e as the log base gives the same figure as the ln row, which is the point.
  • This is a real-number logarithm. Complex logarithms of negative numbers exist in higher mathematics and are not handled here.

Spotted a mistake? Tell us

Log FAQ

For a base's exact powers, count: log₁₀(1000) is 3 because 10 × 10 × 10 = 1000. For anything else, bracket it — log₁₀(50) is between log₁₀(10) = 1 and log₁₀(100) = 2, closer to 2 — then use known values: log₁₀(50) = log₁₀(100) − log₁₀(2) = 2 − 0.30103 = 1.69897. With a calculator that has only ln or log keys, divide: log_b(x) = ln(x) ÷ ln(b).