Logarithm Calculator

How do I calculate a logarithm?

How it is calculated

The logarithm logb(x) answers the question: what power must the base b be raised to in order to get x? The tool uses the change-of-base rule, logb(x) = ln(x) ÷ ln(b), and also shows the natural log ln(x) (base e ≈ 2.71828) and the common log log10(x). The value x must be greater than zero, and the base must be greater than zero and not equal to 1, otherwise no result is shown. Results are rounded to two decimals. Logs of numbers between 0 and 1 are negative.

Worked example

Find log2(64). Natural logs: ln(64) ≈ 4.1589 and ln(2) ≈ 0.6931. Divide: 4.1589 ÷ 0.6931 = 6.00, since 2⁶ = 64. The tool also shows ln(64) = 4.16 and log10(64) = 1.81.

Try this example →

Common mistakes

  • Entering zero or a negative number as the value. Real logarithms are only defined for positive numbers.
  • Using base 1, which has no logarithm because 1 raised to any power is 1.
  • Confusing "log" with "ln". Calculators and textbooks differ on whether log means base 10 or base e; here the base is whatever you type.
  • Swapping value and base. log2(64) = 6 but log64(2) is about 0.17.
  • Assuming log(a + b) = log(a) + log(b). The sum rule applies to products: log(ab) = log(a) + log(b).

About this calculator

This tool calculates the logarithm of a number in any base you choose, answering the question "to what power must the base be raised to get this number", and also reports the same value's natural log (ln, base e) and base-10 log for convenience, since those two bases show up constantly in science and engineering formulas. Logarithms are the inverse of exponentiation, so this calculator is effectively solving b^x = n for x given b and n.

It is used by students working through algebra and precalculus problems, and by anyone in a scientific or technical field dealing with quantities that span huge ranges — pH in chemistry, decibels in acoustics, the Richter scale in seismology, and signal-to-noise ratios in engineering are all logarithmic scales specifically because they compress enormous ranges of values into manageable numbers. Programmers and data analysts also reach for logarithms when transforming skewed data for statistical analysis or visualization.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Because the tool shows log10 alongside your chosen base, it doubles as a quick scale converter. A power ratio of 100 has log10 = 2.00, which is 20 dB, since decibels are 10 times the log of a power ratio. A hydrogen ion concentration of 0.001 mol/L gives log10 = -3.00, so the pH is 3. The sign flips for pH. Which logarithmic scale do you most often convert?

Popular calculators

All Calculators