Math

Logarithm Calculator

Calculate logarithms in any base, and understand what a log actually answers.

Last reviewed by the Radiatus Cloud team

Need this done properly for your business?

Radiatus delivers secure cloud, DevOps & compliance engineering.

Book a free consult

A logarithm answers one question

What power do I raise this base to, in order to get this number? log₁₀(1000) = 3 because 10³ = 1000. Every property of logarithms follows from that, and the confusion people carry usually comes from having learned the rules without the question.

The three bases in use

Base 10, written log, suits anything measured in orders of magnitude — decibels, pH, the Richter scale. Base e, written ln, is the natural logarithm and appears wherever continuous growth or decay does: compound interest, radioactive decay, population models. Base 2, written lg or log₂, dominates computing, because it counts halvings and doublings. A binary search over a million items takes about 20 steps, which is log₂ of a million.

Changing base

Any log converts to any other by dividing: log_b(x) = ln(x) / ln(b). This is why calculators offering only log and ln can still produce log base 7 — and why the choice of base changes a logarithm only by a constant factor, which is the reason computer scientists write O(log n) without specifying one.

The rules turn multiplication into addition

log(ab) = log(a) + log(b), log(a/b) = log(a) − log(b), and log(aⁿ) = n·log(a). This conversion of multiplication into addition is what slide rules exploited and what made logarithm tables one of the most consequential computational tools in history. It is still why very large products are computed in log space — summing logs avoids the overflow that multiplying directly would cause.

The domain is strictly positive

You cannot take the log of zero or a negative number in the reals: no power of a positive base produces them. log(0) tends to negative infinity as the input approaches zero from above. In code this is a frequent runtime failure, since a value that is normally positive occasionally arrives as zero — which is why log-transforming data with zeros conventionally uses log(x + 1).

Log scales compress and reveal

Plotting on a log axis turns exponential growth into a straight line, which makes the growth rate visible as a slope and makes several orders of magnitude fit on one chart. The trade is that equal visual distances represent equal ratios rather than equal differences, so a log chart understates absolute change dramatically. A reader who does not notice the axis is logarithmic will misjudge the magnitude badly, which is why log axes need labelling clearly rather than quietly.

Related tools

  • Percentage Calculator — Calculate percentages, percentage change, increase and decrease, and reverse percentages, with the working shown for each result.
  • Statistical Calculator — Calculate mean, median, mode, standard deviation, and more.
  • Probability Calculator — Calculate probabilities for single and combined events, including conditional probability and Bayes' theorem.
  • Scientific Calculator — Perform advanced mathematical operations including trig, log, and exponents.

Frequently Asked Questions

What does a logarithm actually calculate?

The power a base must be raised to in order to produce a given number. log₁₀(1000) is 3 because 10³ = 1000, and every logarithm rule follows from that.

What is the difference between log and ln?

log usually means base 10 and suits things measured in orders of magnitude; ln is base e and appears wherever continuous growth or decay does, such as compound interest and decay models.

How do I calculate a logarithm in an unusual base?

Divide: log_b(x) = ln(x) / ln(b). Any base converts to any other by a constant factor, which is why computer scientists write O(log n) without specifying one.

Why can't I take the log of zero or a negative number?

Because no power of a positive base produces them. log(0) tends to negative infinity, which is why log transforms on data containing zeros conventionally use log(x + 1).

What does a logarithmic chart axis do?

It turns exponential growth into a straight line and fits several orders of magnitude on one chart, but equal distances then represent equal ratios rather than equal differences.

Privacy & Security

All processing happens locally in your browser — nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Enter the value and the base. The logarithm is computed instantly.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.