How to use the log calculator
- Choose what you want to find: the logarithm itself, the number x that has a given log, or the base.
- Pick the base: 10 (the common log), e (the natural log, ln), 2 (the binary log) or another base you type in.
- Enter the number x, which must be greater than 0, or the log value y when solving backwards.
- Read the answer and the working, which shows the change-of-base step a calculator uses.
How logarithms are calculated
The base b is the number being raised to a power, x is the result, and the logarithm y is the exponent that connects them. A log answers one question: "b to what power gives x?" Since 10³ = 1,000, log₁₀(1,000) = 3.
Calculators only have built-in buttons for ln and log₁₀, so any other base goes through the change-of-base formula. Divide the log of x by the log of the base, using the same kind of log on top and bottom. ln and log₁₀ give the same answer.
Worked example
The calculator opens with log₁₀(250): the power of 10 that gives 250.
- Change of base with natural logs: ln(250) = 5.521460918 and ln(10) = 2.302585093.
- Divide: 5.521460918 ÷ 2.302585093 = 2.397940009.
- Check: 10^2.397940009 = 250.
The answer makes sense. 250 sits between 10² = 100 and 10³ = 1,000, so its log must be between 2 and 3. The whole-number part, 2, is called the characteristic, and the decimal part, 0.39794, is the mantissa. Since 10^0.39794 = 2.5, this splits 250 into 2.5 × 10².
Log rules
| Rule | Example (base 10) |
|---|---|
| log(a × c) = log a + log c | log 200 = log 2 + log 100 = 0.30103 + 2 |
| log(a ÷ c) = log a − log c | log 5 = log 10 − log 2 = 0.69897 |
| log(aⁿ) = n × log a | log 8 = 3 × log 2 = 0.90309 |
| log_b(b) = 1 | log 10 = 1 |
| log_b(1) = 0 | log 1 = 0 |
| log_b(bˣ) = x | log 10⁷ = 7 |
These rules are why logs were invented. Before electronic calculators, people multiplied large numbers by adding their logs from printed tables, and slide rules did the same thing with distances.
Where each base is used
- Base 10 measures orders of magnitude: the pH scale, decibels and the Richter scale of earthquake size all use common logs.
- Base e (about 2.71828) appears wherever growth or decay is continuous: compound interest, population growth, and radioactive decay in the half-life calculator.
- Base 2 counts doublings and bits. log₂(1,024) = 10, so 10 bits can store 1,024 different values.
Frequently asked questions
Why can't I take the log of a negative number or zero?
A positive base raised to any real power always gives a positive result. No power of 10 equals 0 or -5, so those logs have no real value. As x gets closer to 0, its log heads toward negative infinity, but it never reaches a number.
What is the difference between log and ln?
On most calculators and in most school math, "log" means base 10 and "ln" means base e. In advanced math and many programming languages, "log" on its own often means the natural log, so check the convention. You can convert between them: ln(x) = log₁₀(x) × 2.302585.
Can a logarithm be negative?
Yes. The log of a number between 0 and 1 is negative, because you need a negative power to get a fraction. log₁₀(0.01) = -2, because 10⁻² = 1/100. Only x itself has to be positive.
Why can't the base be 1?
Every power of 1 is 1, so 1 can never reach any other number. The question "1 to what power gives 250?" has no answer. Bases must be positive and different from 1.
Related calculators
- Exponent Calculator — Raise any number to any power, including negative and fractional exponents, or solve for the exponent or the base.
- Scientific Notation Calculator — Convert numbers to scientific, E and engineering notation and back, and add, subtract, multiply or divide in a × 10ⁿ form.
- Half-Life Calculator — Radioactive decay and other exponential decay: find the amount left, the starting amount, the time or the half-life.
- Scientific Calculator — Free online scientific calculator with trig in degrees or radians, logs, powers, roots, factorials, memory and history.
Results are calculated in your browser. Double-check anything important before you rely on it. See our disclaimer.