Calculate the logarithm of a number in any base — including common log (base 10) and natural log (base e).
A logarithm answers one question: "what power do I need to raise the base to, in order to get this number?" So log base 10 of 100 equals 2, because 10² = 100. Every log calculation is really just an exponent problem written backwards.
Since browsers only compute natural log directly, every other base is found with the change-of-base formula:
| Base | Name | Typical use |
|---|---|---|
| 10 | Common log | pH scale, decibels, Richter scale |
| e (≈2.718) | Natural log | Calculus, compound growth, half-life |
| 2 | Binary log | Computer science, information theory |
Enter the number you want to find the logarithm of, and enter the base you want to use — common presets like 10, e (natural log), and 2 are usually available as quick options, or you can enter any custom base. Click Calculate, and the tool returns the result. Remember that the number itself must be positive, and the base must be positive and not equal to 1, since these are the mathematical requirements for a logarithm to have a defined, real-number answer.
Logarithms and exponents describe the same relationship from opposite directions. If b^x = y, then log_b(y) = x — the logarithm answers "what exponent do I need?" while the exponential expression answers "what's the result of raising to that power?" For example, since 2^5 = 32, it follows that log base 2 of 32 equals 5. This inverse relationship is why logarithms are the standard tool for "undoing" exponential growth in equations — anywhere you need to solve for an unknown exponent, taking a logarithm of both sides is typically the key algebraic move.
Most calculators and programming environments only have built-in functions for natural log (ln) and sometimes common log (log base 10), not every possible base. The change-of-base formula, log_b(x) = ln(x) / ln(b), solves this by expressing any logarithm in terms of natural logs, which can then be computed directly. This works because of a core logarithm property: the ratio between two logs of the same number, taken in different bases, is a constant scaling factor determined by the relationship between those bases — so dividing ln(x) by ln(b) effectively "converts" the natural log result into whatever base b you actually need.
Some real-world quantities span such an enormous range that a standard linear scale becomes impractical to work with — this is exactly where logarithmic scales come in. The Richter scale for earthquake magnitude is logarithmic, meaning each whole-number increase represents roughly 10 times more ground movement, not just "1 more" unit of severity. The decibel scale for sound works similarly, compressing an enormous range of actual sound pressure into a manageable numeric scale. The pH scale for acidity is a base-10 logarithmic scale as well, where each drop of 1 pH point represents a tenfold increase in acidity. In each case, logarithms compress a vast range of values into something humans can compare and reason about more intuitively.
A few core logarithm rules make manual calculations and algebra much easier. The product rule: log_b(xy) = log_b(x) + log_b(y) — the log of a product equals the sum of the logs. The quotient rule: log_b(x/y) = log_b(x) − log_b(y) — the log of a quotient equals the difference of the logs. The power rule: log_b(x^n) = n × log_b(x) — an exponent inside a log can be pulled out front as a multiplier. These rules are what make logarithms so useful for simplifying complex exponential expressions into more manageable addition and subtraction problems.
Logarithms are the standard tool for solving equations where the unknown variable is in the exponent. For example, to solve 3 to the power of x equals 20 for x, you can't isolate x through normal algebra alone — instead, taking the log of both sides gives x times log(3) equals log(20), which rearranges to x equals log(20) divided by log(3), a calculation this tool can help with directly by finding each individual log value needed.
Why is the logarithm of a negative number undefined? Because no real exponent applied to a positive base can ever produce a negative result — exponential functions with positive bases always output positive values, so there's no real-number answer to "what power gives a negative number."
What's special about the number e in natural log? e (approximately 2.71828) arises naturally in continuous growth and decay processes, making natural log the standard choice in calculus, compound interest formulas, and scientific models of exponential change.
Is log base 10 the same as "log" without a specified base? In many math and science contexts, "log" without a subscript is assumed to mean base 10, though in some computer science and higher-math contexts, unspecified "log" can mean natural log — always check context if it's ambiguous.
Can the base of a logarithm be a fraction, like 1/2? Yes — any positive number except 1 is a valid base, including fractions. A base between 0 and 1 produces a logarithm that decreases as the input increases, the opposite behavior of bases greater than 1.
Why do some fields use log base 2 instead of base 10? Computer science and information theory frequently use base 2 because computing systems fundamentally operate in binary, so log base 2 directly relates to concepts like the number of bits needed to represent a value.
Is there a log of 1 in any base? Yes — the log of 1 is always 0, regardless of the base, since any positive base raised to the power of 0 equals 1.
What's the antilogarithm? An antilog reverses a log calculation — given a log result, it returns the original number by raising the base to that power, essentially undoing the logarithm operation.
Can logarithms handle very large numbers more easily than regular arithmetic? Yes — this is historically one of the main reasons logarithms were invented, since they convert multiplication problems into addition problems, which was especially valuable before calculators existed.
Last reviewed by Mehmed on July 11, 2026.