Log Calculator
Use this log calculator to find the logarithm of a number in base 10, base e (natural log), base 2 or any base you choose. In log mode you also get ln, log₁₀ and log₂ side by side, plus a check that raises the base back to the result. Switch to antilog to go the other way and compute b^y.
Updated
Results
- Equation
- CheckThe inverse operation
- Change of baseLog mode, every base except e
- Natural log, ln xLog mode
- Common log, log₁₀ xLog mode
- Binary log, log₂ xLog mode
Results are estimates. See the methodology below.
How to use the calculator
- Pick a mode. Logarithm answers “b to what power gives x?” Antilog computes b^y.
- Choose the base: 10, e, 2, or a custom base. A custom base must be greater than 0 and not equal to 1.
- Enter x (log mode, must be greater than 0) or y (antilog mode, any number from −1,000,000 to 1,000,000).
In log mode the calculator also shows ln x, log₁₀ x and log₂ x, and for every base except e it writes out the change-of-base step with the numbers filled in. The check line shows the inverse in both modes.
How the calculator works
A logarithm is an exponent. For x > 0, b > 0 and b ≠ 1:
log_b(x) = y means b^y = x
Bases 10, e and 2 use the built-in log functions. Any other base uses the change-of-base formula:
log_b(x) = ln(x) ÷ ln(b)
Results are rounded to 12 significant digits. That removes floating-point noise: log₃(81) shows 4, not 4.000000000000001. MDN notes the same effect in JavaScript, where dividing logs to get log₁₀(1,000) returns 2.9999999999999996.
In antilog mode the calculator returns b^y (e^y for base e). For results beyond about 10^±300, near the limits of ordinary floating-point numbers, it builds the scientific form from y × log₁₀(b): 10^500.5 = 3.16227766 × 10⁵⁰⁰.
Worked examples
| Logarithm | Result | Check |
|---|---|---|
| log₁₀(1,000) | 3 | 10^3 = 1,000 |
| log₁₀(2) | 0.301029995664 | 10^0.301029995664 = 2 |
| ln(10) | 2.30258509299 | e^2.30258509299 = 10 |
| log₂(1,024) | 10 | 2^10 = 1,024 |
| log₀.₅(8) | −3 | 0.5^(−3) = 8 |
1. A custom base, step by step
For log₃(81), the change-of-base line reads ln(81) ÷ ln(3) = 4.39444915467 ÷ 1.09861228867 = 4, because 3⁴ = 81.
2. Doubling time
How many years does money take to double at 5% a year? Solve 1.05^t = 2, which is log₁.₀₅(2) = 14.2066990829. At 7%, log₁.₀₇(2) = 10.2447683511.
3. Counting digits
log₁₀(123,456,789) = 8.09151497717. Drop the decimals and add 1 to get the number of digits, 9. In general a positive whole number n has ⌊log₁₀ n⌋ + 1 digits.
Where logarithms show up
Logarithmic scales compress huge ranges into small numbers, so each step of 1 means a factor of 10. The USGS describes pH in logarithmic units: water at pH 5 is ten times more acidic than water at pH 6. For earthquake magnitude, the USGS says each whole number is a tenfold increase in measured amplitude and about 32 times more energy release. Because log₁₀(10,000) = 4, a difference of 4 magnitude units means 10,000 times the amplitude.
Frequently asked questions
Does “log” mean base 10 or the natural log?
It depends on who wrote it. OpenStax's College Algebra uses log x with no base for the common logarithm, base 10, while ln x always means base e. Software often differs: MDN documents that JavaScript's Math.log returns the natural logarithm. Check which base a formula or tool means before you mix results.
What is ln?
ln is the natural logarithm, the logarithm to base e, where e is about 2.71828182846 (the antilog of 1 in base e). ln(10) = 2.30258509299. Natural logs appear in continuous growth and decay, calculus and statistics.
Why can't I take the log of 0 or a negative number?
A positive base raised to any real power is always positive, so no real exponent gives 0 or a negative number. The real logarithm is defined only for x > 0. Base 1 is excluded too, because 1 to any power is 1.
What is an antilog?
The antilog undoes a logarithm: antilog₁₀(3) = 10^3 = 1,000. It also works for negative and fractional exponents: 10^(−7.4) = 3.981071706 × 10⁻⁸.
How do I calculate a log with a different base?
Divide two logs in the same base: log_b(x) = ln(x) ÷ ln(b), or log₁₀(x) ÷ log₁₀(b). Either gives the same answer. Choose Custom base and the calculator shows this step with your numbers.
Can the result be negative?
Yes. With a base greater than 1, any x between 0 and 1 has a negative log: log₁₀(0.001) = −3. With a base between 0 and 1 the signs flip, so log₀.₅(8) = −3.
Sources
This calculator is a math tool for learning and checking work. Results are rounded to 12 significant digits.