Home / Math / Logarithm Calculator
Logarithm Calculator
Find the logarithm of a positive number in base 10, base e, base 2 or any base you choose, or go the other way and raise the base to a power. The page also shows the three common logs together.
What a logarithm is
A logarithm answers the question: to what power must the base be raised to get this number? Writing logb(x) = y is the same statement as by = x. So log10(1000) = 3, because 103 = 1000, and log2(8) = 3, because 23 = 8. The antilogarithm is the reverse step: given y and the base, it returns x.
Logs turn multiplication into addition, which is why they were central to calculation before electronic calculators and still organise many scales, such as decibels, pH and the Richter magnitude, where each step represents a multiplication.
The three common bases
- Base 10 (common log, often written log): counts digits and powers of ten. It is used in scientific notation and many measurement scales.
- Base e (natural log, ln): the base e is approximately 2.718281828. It is the natural choice in calculus, continuous growth and decay.
- Base 2 (binary log): counts doublings and bits, so it appears in computing and information theory. A number that needs 1,024 values takes 10 bits.
Calculators sometimes write plain "log" for base 10 and sometimes for base e, depending on the field. This page labels the base on every result to avoid that ambiguity.
Change of base and the laws of logs
Any logarithm can be computed from natural logs with the change-of-base rule: logb(x) = ln(x) ÷ ln(b). This is how the custom-base option works. Floating-point division can leave tiny errors, so when the quotient is within one part in a trillion of a whole number and the base raised to that whole number matches the input, the page returns the whole number.
| Law | Statement |
|---|---|
| Product | log(xy) = log(x) + log(y) |
| Quotient | log(x ÷ y) = log(x) − log(y) |
| Power | log(xk) = k × log(x) |
Domain limits and common mistakes
Real logarithms exist only for positive numbers. Log of zero is undefined, because no power of a positive base reaches zero, and the log of a negative number is not real. The base must be positive and not 1, since powers of 1 are always 1. Another frequent slip is expecting log(x + y) to equal log(x) + log(y); only products split into sums. Also remember that logarithms of numbers between 0 and 1 are negative, so log base 10 of 0.01 is −2, and that a logarithm grows slowly: doubling the input adds only a fixed amount, about 0.301 in base 10. Relationships between logs and powers are explored further in the exponent calculator, and very large or small values are easier to read with the scientific notation calculator.
Worked example
How many times must 2 be multiplied by itself to reach 1,024? The binary logarithm answers exactly that.
Inputs
| Calculation | Logarithm: find log of a number |
|---|---|
| Base | 2 (binary log) |
| Value | 1024 |
Result
Logarithm of 1,024 to the base 2.
| Result | 10 |
|---|---|
| Common log, log₁₀(x) | 3.0102999566 |
| Natural log, ln(x) | 6.9314718056 |
| Binary log, log₂(x) | 10 |
| Change of base | ln(1,024) ÷ ln(2) = 6.9314718056 ÷ 0.6931471806 |
| Meaning | 2 raised to 10 gives 1,024 |
Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.
Frequently asked questions
What is the difference between log and ln?
Log usually means base 10 and ln means base e, the natural logarithm. Some textbooks use log for base e, so check the convention, or read the base shown on this page.
How do I calculate a logarithm with a custom base?
Divide the natural log of the number by the natural log of the base. For log base 3 of 81 that is ln(81) ÷ ln(3) = 4.
What is an antilog?
An antilogarithm undoes a logarithm. If log base b of x equals y, then the antilog of y is b raised to the power y, which returns x.
Why can I not take the log of zero or a negative number?
No real power of a positive base can produce zero or a negative result, so the real logarithm is undefined there. Only positive inputs are accepted.
Why is the base not allowed to be 1?
Every power of 1 equals 1, so no exponent could produce any other number. The change-of-base formula would also divide by ln(1) = 0.
Related calculators
References and sources
- NIST Digital Library of Mathematical Functions, section 4.2: logarithms and exponentials. Link
- ISO 80000-2: Quantities and units, mathematical signs and symbols, which defines ln, lg and lb.