This log calculator finds the logarithm of any positive number in base 10, base e (the natural log, ln), base 2 or any custom base, and it works in reverse as an antilog calculator. You get the result, the same number’s logarithm in the three standard bases, and the change-of-base steps with a check that raising the base to the answer returns your number.
What a logarithm is
A logarithm answers the question “what power do I raise the base to, to get this number?” Logarithms and exponents are inverse operations:
log_b(x) = y means bʸ = x log₁₀(1,000) = 3 because 10³ = 1,000 log₂(1,024) = 10 because 2¹⁰ = 1,024 ln(x) = log_e(x), e ≈ 2.718281828
The argument x must be positive and the base must be positive and not equal to 1. There is no real power of 10 that gives 0 or a negative number, which is why log(0) and log(−5) are undefined.
The change-of-base formula
Calculators and programming languages usually provide only ln and log₁₀. Any other base is computed from them:
log_b(x) = ln(x) ÷ ln(b) = log₁₀(x) ÷ log₁₀(b)
For example, log₃(81) = ln(81) ÷ ln(3) = 4.394449 ÷ 1.098612 = 4, and indeed 3⁴ = 81. The calculator uses the built-in log₁₀, ln and log₂ functions directly for those bases, which avoids tiny rounding errors like 2.9999999999999996.
Worked examples
- Common log: log₁₀(1,000) = 3; log₁₀(0.001) = −3. Every factor of 10 adds 1 to the common log.
- Natural log: ln(20) = 2.99573227355. Natural logs appear in growth, decay and continuous compounding.
- Binary log: log₂(1,024) = 10, the number of bits needed to count 1,024 values.
- Custom base: log1.5(50) = ln(50) ÷ ln(1.5) = 3.912023 ÷ 0.405465 = 9.64824: something growing 50% per period takes about 9.65 periods to multiply by 50.
- Antilog: the antilog of 2.5 in base 10 is 102.5 = 316.227766017, and the natural antilog of 1 is e¹ = 2.71828182846.
Solving exponential equations with logs
Logs bring an unknown exponent down to the ground. To solve 5ˣ = 200, take the log of both sides: x · log 5 = log 200, so x = log 200 ÷ log 5 = 2.30103 ÷ 0.69897 = 3.29203. That is the same as log₅(200), which you can enter directly with a custom base of 5.
Logarithm rules
| Rule | Formula | Example |
|---|---|---|
| Product | log(xy) = log x + log y | log 20 = log 2 + log 10 = 0.30103 + 1 = 1.30103 |
| Quotient | log(x/y) = log x − log y | log 5 = log 10 − log 2 = 0.69897 |
| Power | log(xⁿ) = n · log x | log 8 = 3 · log 2 = 0.90309 |
| Log of 1 | log_b(1) = 0 | ln 1 = 0 |
| Log of the base | log_b(b) = 1 | log₂ 2 = 1 |
| Inverse | b^(log_b x) = x | 10^(log 7) = 7 |
Common values
| x | log₁₀ x | ln x | log₂ x |
|---|---|---|---|
| 1 | 0 | 0 | 0 |
| 2 | 0.30103 | 0.693147 | 1 |
| e ≈ 2.71828 | 0.434294 | 1 | 1.442695 |
| 10 | 1 | 2.302585 | 3.321928 |
| 100 | 2 | 4.605170 | 6.643856 |
| 0.5 | −0.30103 | −0.693147 | −1 |
Estimating a logarithm in your head
Memorize two values, log₁₀ 2 ≈ 0.301 and log₁₀ 3 ≈ 0.477, and the rules above do the rest. The digits before the decimal point (the characteristic) come from the power of ten, and the decimal part (the mantissa) from the leading digits:
log₁₀(3,000) = log₁₀(3) + log₁₀(1,000) ≈ 0.477 + 3 = 3.477 log₁₀(0.02) = log₁₀(2) − 2 ≈ 0.301 − 2 = −1.699 log₁₀(5) = log₁₀(10) − log₁₀(2) ≈ 1 − 0.301 = 0.699
To switch to a natural log, multiply a common log by 2.302585; to get a base-2 log, multiply by 3.321928.
Logs in spreadsheets and code
In Excel and Google Sheets, LOG10(x) is the common log, LN(x) the natural log, and LOG(x, b) any base (LOG(x) without a base means base 10). In JavaScript and Python, log() is the natural log, so log(x) in code equals ln on this page; use log10() and log2() for the other standard bases. The antilog is POWER(b, y) or b^y in a spreadsheet and EXP(y) for base e.
Where logarithms are used
- pH: pH = −log₁₀[H⁺]. A hydrogen-ion concentration of 10−7 mol/L gives pH 7.
- Decibels: sound level in dB = 10 · log₁₀(I ÷ I₀). Every +10 dB is 10 times the intensity.
- Earthquakes: each whole step on the magnitude scale is about 31.6 times more energy (101.5).
- Doubling time: money growing at 7% a year doubles in ln 2 ÷ ln 1.07 = 10.24 years. See the compound interest calculator.
- Half-life: decay problems solve for time with ln, as in the half-life calculator.
Related calculators
- Exponent Calculator
- Scientific Notation Calculator
- Scientific Calculator
- Square Root Calculator
- Compound Interest Calculator
Frequently Asked Questions
What is the difference between log and ln?
log usually means base 10 (the common log) and ln means base e ≈ 2.71828 (the natural log). They differ by a constant factor: ln x = 2.302585 × log₁₀ x.
How do I calculate a log with a different base?
Use the change-of-base formula log_b(x) = ln(x) ÷ ln(b). For example, log₃(81) = 4.394449 ÷ 1.098612 = 4.
What is an antilog?
The antilog is the inverse of a logarithm: the antilog of y in base b is bʸ. The base-10 antilog of 2 is 10² = 100.
Why is the log of 0 or a negative number undefined?
No real power of a positive base gives 0 or a negative number, so there is no real answer. As x approaches 0, log x heads toward minus infinity.
Can a logarithm be negative?
Yes. Any number between 0 and 1 has a negative logarithm in a base above 1, for example log₁₀(0.001) = −3.