Logarithm calculator
Enter a base and a number to get the logarithm, plus ln, log₁₀ and log₂ of the number, or solve b^x = y for x and compute antilogs.
Show the working, step by step
Use the change-of-base rule with natural logs.
log2(1024) = ln(1024) ÷ ln(2) = 6.93147 ÷ 0.693147 = 10
Logarithm rules
log_b(x) = y ⇔ b^y = x log_b(x) = ln(x) ÷ ln(b) log(xy) = log x + log y, log(x/y) = log x − log y, log(x^k) = k·log x
A logarithm answers “what power of the base gives this number?”: log₂(1024) = 10 because 2¹⁰ = 1024. It only exists for positive numbers, and the base must be positive and not 1.
How to use the logarithm calculator
Choose the calculation. log base b of x asks “what power of b gives x?” and needs a base and a positive number. Antilog goes the other way: it raises the base to a power you enter. Solve b^x = y finds the exponent when you know the base and the result. The answer appears at the top with the change-of-base working underneath, together with the common logarithm (base 10) and the natural logarithm (base e).
Example
Take log₂(1024). Since 2¹⁰ = 1024, the answer is 10. For a base that is not a neat power, use the change-of-base rule: log₅(100) = ln 100 ÷ ln 5 = 4.6052 ÷ 1.6094 = 2.8614. To check, 52.8614 is about 100. In the solve mode, 2x = 1000 gives x = ln 1000 ÷ ln 2 = 9.9658, so a quantity that doubles every period passes 1000 a little before its tenth doubling.
The three bases you will meet
- Base 10 (log or log₁₀): counts digits and orders of magnitude. log 1000 = 3 and log 0.01 = −2.
- Base e (ln): the natural logarithm, with e ≈ 2.71828. It is the logarithm of calculus, growth and decay. ln 10 = 2.3026 and ln 2 = 0.6931.
- Base 2 (log₂): counts doublings and bits. log₂ 8 = 3, and it appears in computer science and information theory.
Logarithm rules
The product rule turns multiplication into addition: log(xy) = log x + log y. The quotient rule gives log(x ÷ y) = log x − log y, and the power rule moves exponents to the front: log(xk) = k·log x. A few special values are worth remembering: log_b(1) = 0 for every base, log_b(b) = 1, and log_b(bk) = k. These rules are why logs once replaced slide-rule multiplication and still simplify equations with exponents.
What logarithms are used for
- Earthquake magnitude: each whole step on the Richter scale is a tenfold increase in measured amplitude.
- Sound and decibels: a tenfold rise in power adds 10 dB, and a doubling adds about 3 dB.
- pH: pH = −log₁₀ of hydrogen-ion concentration, so a pH of 3 is ten times more acidic than 4.
- Compound growth: the time to grow from A to B at a rate r is ln(B ÷ A) ÷ ln(1 + r); doubling at 7% takes ln 2 ÷ ln 1.07 ≈ 10.2 periods.
- Computing: a binary search over 1,000,000 items needs about log₂(10⁶) ≈ 20 steps.
Working an equation with logarithms
Logs solve equations where the unknown is an exponent. If a savings balance grows 5% a year, how long to triple? Solve 1.05t = 3 by taking logs: t = ln 3 ÷ ln 1.05 = 1.0986 ÷ 0.04879 = 22.5 years. Use the solve mode with base 1.05 and result 3 to confirm. The same method gives the half-life of a drug or the time for a population to double: pick the base as the growth factor per period and the result as the multiple you want.
Reading very large and very small numbers
A base-10 logarithm turns a huge range into a small one. The numbers 1, 1,000 and 1,000,000,000 have logs of 0, 3 and 9, which is why charts of data that spans many orders of magnitude use a log scale. Equal steps on the axis mean equal multiples, not equal differences. Estimate a log without a calculator by counting digits: 4,500 has 4 digits, so log₁₀ 4,500 lies between 3 and 4 (it is 3.65).
Logarithm of a power
log₁₀(106) = 6 and ln(e3) = 3 because a log undoes its own base. It is the inverse of exponentiation.
Domain and limits
Logarithms of zero or of negative numbers are not defined in the real numbers, and the base must be positive and not equal to 1. The calculator tells you when an input is outside that range. A log is negative when x is between 0 and 1, zero at x = 1 and positive beyond. Results are shown to many significant figures, and are exact only for exact powers such as log₂ 1024 = 10.
Common mistakes
- Writing log(x + y) = log x + log y. The rule is for products, not sums.
- Confusing log and ln. “log” means base 10 in most schools and base e in some programming languages and textbooks.
- Forgetting the base. log₂ 100 is 6.64, log₁₀ 100 is 2 and ln 100 is 4.61.
- Rounding too early. Keep several decimals until the final step, especially in change-of-base work.
Common questions
What is a logarithm?
The exponent you raise the base to in order to get a number. log₁₀(1000) = 3 because 10³ = 1000.
How do you calculate a log with any base?
Use change of base: log_b(x) = ln(x) ÷ ln(b). log₂(1024) = ln 1024 ÷ ln 2 = 10.
Why can’t you take the log of zero or a negative number?
No real power of a positive base gives 0 or a negative result, so the real logarithm is undefined there.
What is the difference between log and ln?
log usually means base 10 and ln means base e (about 2.718). ln 100 is 4.605 while log 100 is 2.
How do I find a logarithm with any base?
Use the change-of-base rule: log_b(x) = ln(x) ÷ ln(b), or log(x) ÷ log(b) with any base. For log₇ 50, 3.912 ÷ 1.946 = 2.01.
Why can't I take the log of a negative number?
No real power of a positive base gives a negative result, so log_b(x) has no real value for x ≤ 0.
What is an antilogarithm?
It is the inverse of a log: raise the base to the log value. The antilog of 2.5 in base 10 is 102.5 = 316.23.
What is log base 2 of 8?
3, because 2 × 2 × 2 = 8. Likewise log₂ 16 = 4 and log₂ 1024 = 10.
Related calculators
-
Function calculator
Plot f(x).
-
Exponential growth
Growth and decay.
-
Lognormal distribution
Logs of data.
-
Rounding calculator
Scientific notation.