Logarithm Calculator

A logarithm answers one question: to what power must the base be raised to reach this number? This calculator works it out in any base, shows the change-of-base steps behind the answer, and runs the relationship in reverse as well: the antilog (inverse log), a find-the-base solver, and the product, quotient and power laws evaluated from both sides so you can watch the laws hold.

Try an example

How to use this calculator

  1. Logarithm mode is the main tool: enter the number x and pick the base (2, 10, e for the natural log, or any custom base). The answer comes with the change-of-base working and a check that raising the base to the answer returns your number.
  2. Antilog mode runs it backwards: give the base and the logarithm value y, and it returns x = by, the number whose logarithm that is.
  3. Find the base solves the third side of the triangle: given x and the logarithm value y, it finds the base b = x1/y.
  4. Log laws mode evaluates the product, quotient and power laws from both directions, combined first and expanded, so the equality is demonstrated with your numbers rather than just stated.

The method

Definition and change of base

logb(x) = y means exactly by = x.   Computed as: logb(x) = ln(x) / ln(b)

Most calculators and programming languages provide only the natural log (ln, base e) and the common log (base 10). The change-of-base formula turns either into any base at all: divide the log of the number by the log of the base, using the same log on top and bottom. That is the whole trick behind “how to enter log base 2 on a calculator”: there is no base button, so you divide.

The three working bases

  • Base 2 runs computing: bits, binary search, doubling times. log2(1024) = 10 says ten doublings of 1 reach 1024.
  • Base 10, the common log, matches our number system: its whole-number part counts digits roughly, which is why scales like pH and decibels use it.
  • Base e, the natural log (ln), is the one calculus prefers, because the growth it describes is its own rate. e is about 2.718281828; choose “e” rather than typing the decimal, so the base is exact.

The laws

Product: logb(x·y) = logb(x) + logb(y)   Quotient: logb(x/y) = logb(x) − logb(y)   Power: logb(xn) = n · logb(x)

Two anchor facts sit underneath everything: logb(1) = 0 for every base (any base to the power 0 is 1), and logb(b) = 1. The domain is strict: x must be positive, the base must be positive, and the base cannot be 1 (ln(1) = 0 would make the change-of-base division a division by zero, and 1 raised to any power is only ever 1).

Worked examples

Example 1: log base 2 of 1024

ln(1024) = 6.931471806 and ln(2) = 0.6931471806; dividing gives exactly 10, and the check confirms it: 210 = 1024. Ten doublings. This is the preloaded example.

Example 2: log base 10 of 2

log10(2) = 0.3010299957. This unassuming number is why 210 (1024) sits so close to 103 (1000): ten times 0.3010299957 is 3.010299957, a whisker over 3. It is also why a doubling is almost exactly +3 decibels.

Example 3: a negative answer is a fraction

log5(0.2) = −1, exactly, because 5−1 = 1/5 = 0.2. Logarithms of numbers between 0 and 1 are always negative; that is a result, not an error.

Example 4: the natural log

ln(7) = 1.945910149. In the tool this is base “e”; choosing a custom base and typing 2.718281828 instead would give nearly the same digits, but the built-in e is exact and the typed decimal is not.

Example 5: antilog and find the base

The antilog of 3 in base 10 is 103 = 1000: the number whose log is 3. Working the third side: if log of 81 comes out as 4, the base is 811/4 = 3, and indeed 34 = 81.

Example 6: the product law, both sides

log2(8 × 4): combined first, log2(32) = 5. Expanded: log2(8) + log2(4) = 3 + 2 = 5. Same answer, as the law promises; the laws mode shows both routes for your own numbers.

Reading your results

The steps are the change of base made visible: ln of the number, ln of the base, and their quotient. If a result looks wrong, the steps show whether the inputs were read as intended. The check line raises the base to your answer and should return the starting number, up to rounding in the last digits; that round trip is the definition of a logarithm doing its job.

The comparison row shows the same number’s logarithm in the other two standard bases. Watching all three at once builds the right instinct: the values differ, sometimes by a lot, because the base is part of the question. “The log of 1000” is 3, about 9.97, or about 6.91 depending on whether the base is 10, 2 or e.

Exact results are flagged. When the answer is a whole number (or the base in find-the-base mode comes out whole), the tool says so, because an exact power relationship is stronger information than a decimal approximation.

Common mistakes

  • Inventing a sum law. There is no rule for log(x + y). The product law is about multiplication: log10(100 + 1000) = log10(1100), about 3.04, not the 2 + 3 = 5 that misapplying the product law would suggest.
  • Trying the log of zero or a negative. No power of a valid base gives 0 or a negative number, so real logarithms of them do not exist. The tool refuses with the reason rather than returning a confusing NaN.
  • Using base 1. 1 to any power is 1, so log base 1 can answer nothing except a contradiction; the change-of-base formula shows why: ln(1) = 0 and the division explodes.
  • Typing e as a decimal. 2.72 (or even 2.718281828) as a custom base gives a slightly wrong base and slightly wrong answers. The e option uses the exact constant.
  • Assuming log always means base 10. On school calculators log is base 10 and ln is base e; in much of higher mathematics log means the natural log. The base changes the answer, so state it, as this tool makes you.
  • Fearing negative answers. A negative logarithm simply means the number sits between 0 and 1. log10(0.01) = −2 is exact and ordinary.

Limitations

  • Real numbers only. Logarithms of negative numbers exist in complex arithmetic (they involve multiples of πi) and are out of scope here; the domain rules above are the real-number rules.
  • Arithmetic is double precision, about 15 to 16 significant digits, with results shown to 10. The final digit of a long decimal can differ by one from a high-precision package; exact power relationships are detected and flagged at the precision available.
  • The discrete logarithm (finding an integer exponent inside modular arithmetic, the problem cryptography relies on being hard) is a different problem and not what this tool solves; see the FAQ.
  • Antilog results overflow above about 1.8 × 10308; the tool says so plainly instead of printing infinity.

Frequently asked questions

How do I work out log base 2 on a normal calculator?

Divide. log2(x) = ln(x) / ln(2), or equally log10(x) / log10(2): the same log top and bottom, either one. That is the change-of-base formula, it is how every calculator does it internally, and it is exactly the steps this tool shows. The same trick enters any base a basic calculator lacks.

What is the difference between log and ln?

Nothing structural: ln is simply the logarithm with base e, given its own name and button because calculus uses it constantly. “log” without a base means base 10 on school calculators and in engineering, and base e in much of pure mathematics, which is why this tool always makes the base explicit.

Why is the logarithm of 0 undefined?

Because no power of a valid base reaches 0. As x shrinks toward 0, log10(x) plunges: log of 0.001 is −3, of a millionth is −6, and it never lands anywhere. The same argument excludes negatives: a positive base raised to any real power stays positive.

What is the inverse of a logarithm?

The exponential with the same base, often called the antilog: if logb(x) = y then x = by. The antilog mode above is that inverse, and the find-the-base mode solves the remaining side of the same relationship.

What is a discrete logarithm?

A different problem with a similar name: finding an integer exponent inside modular (clock) arithmetic, for instance solving 3k = 13 (mod 17). It is easy to check and famously hard to reverse, which is why cryptography uses it. This tool computes ordinary real logarithms and does not solve discrete ones.

Can this graph a logarithmic function?

No, it computes values and shows the working. For the picture: a log curve passes through (1, 0), climbs steeply at first, then ever more slowly, and dives without ever touching 0 on the left. Graphing tools draw it; this one makes sure the numbers underneath are right.

Related calculators

Method: logarithms computed by the change-of-base formula log_b(x) = ln(x) / ln(b) in double precision and shown to 10 significant digits, with domain enforced (x above 0, base above 0, base not 1); antilog as b^y; base solving as x^(1/y); the product, quotient and power laws evaluated from both sides. Last reviewed: 21 October 2026.

Disclaimer: This calculator gives estimates for general information only. It is not financial, medical or other professional advice.