Math & Geometry
Logarithm Calculator (log, ln, log2, any base)
Find the logarithm of a number in any base. Enter a positive number, choose base 10, the natural base e, base 2 or your own base, and the calculator returns the logarithm together with ln, log₁₀ and log₂ of the same number. A check line raises the base to the result so you can see that it gives back your number.
How to use this calculator
- Enter the number x; it must be greater than 0.
- Choose the base: 10, e, 2 or Other base.
- For another base, type it in the custom base field; it must be positive and not 1.
- Read the logarithm in your base and the three standard logarithms.
- Use the check line to confirm that the base raised to the result returns x.
What a logarithm tells you
A logarithm answers the question: to what power must I raise the base to get this number? Because 10 × 10 × 10 = 1000, the base-10 logarithm of 1000 is 3. Logarithms turn multiplication into addition — log(a × b) = log a + log b — which is why they were used for centuries in tables and slide rules to multiply large numbers by hand.
Three bases appear most often. Base 10, the common logarithm, is used in scientific notation and in scales such as pH and decibels. Base e, the natural logarithm written ln, appears wherever growth is continuous: compound interest, population growth, radioactive decay and calculus. Base 2, the binary logarithm, counts doublings and is used throughout computing, for example to find how many bits are needed to store a number.
Change of base and the rules of logs
Calculators usually offer only ln and log₁₀, but any base can be reached with the change-of-base rule: log_b(x) = ln(x) ÷ ln(b). The calculator uses this rule for custom bases and shows the result to ten decimal places. The other rules follow from the definition: log_b(1) = 0 in every base, log_b(b) = 1, log_b(xⁿ) = n × log_b(x), and log_b(x ÷ y) = log_b(x) − log_b(y). Logarithms of numbers between 0 and 1 are negative: log₁₀(0.01) = −2.
Where logarithms are used
Many everyday scales are logarithmic because they cover huge ranges. The pH of a solution is the negative base-10 logarithm of its hydrogen ion concentration, so pH 3 is ten times more acidic than pH 4. Sound levels in decibels and earthquake magnitudes work the same way. In finance, the number of years needed to double money at a rate r is ln 2 ÷ ln(1 + r), and in science the half-life of a substance is ln 2 divided by its decay constant. The logarithm of 0 or of a negative number is not defined among real numbers, so the calculator asks for a positive x and a positive base other than 1.
Formula & method
log_b(x) = y ⇔ b^y = xChange of base: log_b(x) = ln(x) ÷ ln(b)ln(x) = log_e(x), e ≈ 2.718281828log_b(x) = y means b^y = x. Any logarithm can be computed with natural logarithms: log_b(x) = ln(x) ÷ ln(b). The natural logarithm uses Euler's number e ≈ 2.718281828.
Worked example
Three logarithms
- log₁₀(1000) = 3, because 10³ = 1000
- log₂(8) = 3, because 2³ = 8
- log₃(81) = ln 81 ÷ ln 3 = 4.394449 ÷ 1.098612 = 4
Answer: Each answer is the exponent that turns the base into the number.
Frequently asked questions
What is the difference between log and ln?
log usually means base 10 and ln means base e (about 2.718). 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 rule log_b(x) = ln(x) ÷ ln(b), or choose Other base in the calculator and enter the base.
Why can't I take the log of 0 or a negative number?
No real power of a positive base gives 0 or a negative number, so these logarithms are undefined among real numbers.
What is an antilog?
The inverse of a logarithm: the antilog of y in base b is b^y. The check line in the calculator shows it.
Why is the log of a number below 1 negative?
Because the base must be raised to a negative power to get a fraction: 10⁻² = 0.01, so log₁₀(0.01) = −2.
What is log base 2 used for?
Counting doublings and bits: log₂(1024) = 10, so 10 bits can represent 1,024 values.