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
- Meaning
- 5 raised to the power 2.226566 gives 36
- Working (change of base)
- ln(36) ÷ ln(5) = 3.583519 ÷ 1.609438 = 2.226566
- Log base 10
- 1.556303
- Natural log (ln, base e)
- 3.583519
- Log base 2
- 5.169925
- Check
- 5^2.226566 = 36
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
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).
- ln is the natural logarithm, base e (about 2.71828); log written without a base usually means base 10 in school and engineering, though in some maths and computing texts a bare log means base e or base 2. They differ by a constant factor: ln(x) = 2.302585 × log₁₀(x). The page shows both for every input so there is no guessing.
- Choose 'Any other base', type the base, and the page divides ln(number) by ln(base). log₃(81) = ln(81) ÷ ln(3) = 4.394449 ÷ 1.098612 = 4, because 3⁴ = 81.
- The antilog undoes the logarithm: if log₁₀(x) = 2.5 then x = 10^2.5 = 316.23. The check row on this page does exactly that for your answer, and the exponent calculator on this site raises any base to any power.
- Base 2 counts doublings and bits: log₂(1024) = 10 says 1024 is ten doublings of 1, and a number needs about log₂(n) bits to store. It appears in information theory, algorithm analysis and music (octaves are doublings of frequency).
Related calculators
- Exponent Calculator (Powers, Negative and Fractional Exponents, Solve for x)
- Scientific Notation Calculator (Convert Both Ways, with Steps)
- Square Root Calculator (Simplified Radical, Negative Numbers)
- Rounding Calculator: Decimals, Significant Figures, Nearest 10 or Fraction
- Percent Change Calculator: Increase or Decrease, With Working
- Half-Life Calculator (Radioactive and Exponential Decay)