Free tool
Log calculator, any base, with the steps.
Type a number and pick a base to get its logarithm: log base 10, the natural log ln, log base 2 or any base you choose. The answer is exact when it can be (log₂ 8 is 3), with the change of base formula written out when not. Also the antilog, solving b^x = y, and a check of the product, quotient and power rules.
Try the log rules with the same base
What to work out
Base
Type whole numbers, decimals like 0.25 or fractions like 1/8.
Worked out in your browser. Nothing is sent anywhere.
Guide
How to use a logarithm calculator, with worked examples.
A logarithm calculator finds the power you must raise a base to in order to get a number. The log of 1,000 to base 10 is 3, because 10³ = 1,000. This calculator does log base 10, the natural log (ln, base e), log base 2 and log to any base you type, shows the answer exactly when there is an exact one, and writes out the change of base formula when there is not.
How to use the log calculator
- Pick Log of x to find a log, Antilog (b^y) to go the other way, or Solve b^x = y to find an unknown exponent.
- Choose the Base: 10, e, 2 or Other base, and type your own in the Base b box.
- Type the number. Whole numbers, decimals and fractions such as 1/8 all work.
- The big card is the answer for your base. The small cards show the same number in the other common bases. The steps and formula come next.
- Use Copy result or Copy link.
Log base 10, ln and log base 2
Log base 10 is the common log, often written log or log₁₀. It counts the zeros in a power of ten: log 1,000 = 3 and log 0.001 = −3. The natural log ln uses base e ≈ 2.71828 and shows up in growth and decay. Log base 2 counts how many times you can halve a number, which is why computer science uses it: log₂ 8 = 3 and log₂ 1,024 = 10. Many calculators label log base 10 as just "log", while some programming languages use "log" for the natural log, so check the base when you compare answers.
The change of base formula
log_b(x) = ln(x) ÷ ln(b). You can use log base 10 instead of ln, and the answer is the same. For log₃ of 20: ln 20 = 2.995732 and ln 3 = 1.098612, so log₃ 20 = 2.995732 ÷ 1.098612 = 2.726833. The calculator writes these steps out when the answer is not exact.
Exact answers
When the number is a rational power of the base the calculator finds the exact answer by comparing prime factors, so you see 3 and not 2.9999999. Log₂ 8 = 3. Log₈ of 1/4 = −2/3, because 8 is 2³ and 1/4 is 2⁻², and −2 ÷ 3 = −2/3. Log₁₀ 0.001 = −3 exactly.
Antilog and solving for an exponent
The antilog undoes the log: if log₁₀ x = 2.5 then x = 10^2.5 = 316.227766. To solve 2^x = 50, take the log of both sides: x = log₂ 50 = ln 50 ÷ ln 2 = 5.643856. Pick Solve b^x = y, set the base to 2 and type 50.
The three log rules
- Product: log(M × N) = log M + log N.
- Quotient: log(M ÷ N) = log M − log N.
- Power: log(M^k) = k × log M.
The table under the answer checks each rule for any M, N and k you type. With M = 8, N = 4 and base 2: log₂ 8 = 3 and log₂ 4 = 2, so log₂ 32 = 5, which is 3 + 2.
Common problems
- Log of 0 or a negative number. No real power of a positive base gives 0 or a negative number, so there is no real answer. For a negative number the calculator shows the complex value.
- Base 1. 1 to any power is 1, so it cannot be a base. The base must be above 0 and not 1.
- Rounding. Answers that are not exact are rounded to 12 significant digits.
For exponents see the exponent calculator, for longer sums use the scientific calculator, and to plot y = log x try the graphing calculator.
Questions
Good to know.
What is log base 10?
The power of 10 that gives your number. Log of 100 is 2 because 10² = 100, and log of 1,000 is 3.
What is the difference between log and ln?
Log usually means base 10 and ln means base e, about 2.71828. This calculator lets you choose the base so there is no doubt which one you get.
How do I calculate a log with a different base?
Use the change of base formula: log_b(x) = ln(x) ÷ ln(b). Choose Other base, type b, then x. The steps show both logs and the division.
What is an antilog?
The inverse of a log. If log₁₀ x = 3 then the antilog is 10³ = 1,000. Choose Antilog (b^y) and type the log value.
How do I solve 5^x = 100?
Take the log of both sides: x = log₅ 100 = ln 100 ÷ ln 5 = 2.861353. Choose Solve b^x = y, set the base to 5 and type 100.
Why can I not take the log of a negative number?
A positive base raised to any real power is always positive, so no real exponent gives a negative number or 0.
What is log₂ used for?
Counting how many times a number halves or how many bits it needs. log₂ 1,024 = 10, which is why 1,024 values fit in 10 bits.
Is anything sent anywhere?
No. It all runs in your browser, and your last inputs are remembered on this device only.