Toolvito

Works on this device

Logarithm Calculator

Find log, ln or a logarithm in any base, and get an exact answer when one exists. You can also go back from a logarithm to the number, join or split logarithms with the log rules, solve an equation, and make a log table.

Enter your values

Finds log, ln, log base 2 or a logarithm in your own base. The answer is exact when the number is an exact power of the base.

Your values

A number greater than 0. You can type a decimal such as 0.001, a fraction such as 1/8, or a large number such as 2.5e12.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose the button below them.

How to use this calculator

  1. Choose what you want to work out, for example Logarithm of a number (any base).
  2. Enter the number. You can type a decimal such as 0.001, a fraction such as 1/8 or a large number such as 2.5e12.
  3. Choose the base: 10 for log, e for ln, 2, or Another base to type your own.
  4. Choose Calculate. The result shows the logarithm, the same number in the other common bases, and the exponential form.

What a logarithm is

A logarithm answers one question: to which power must the base be raised to give the number? In symbols, log_b(x) = y means the same as b^y = x.

log with no base written is base 10 on this page (the common logarithm). ln is base e, where e = 2.718281828… (the natural logarithm). Base 2 is the binary logarithm.

  • Change of base: log_b(x) = ln(x) ÷ ln(b). This is how a logarithm in any base is found.
  • Antilogarithm: the antilog of y in base b is b^y. It undoes the logarithm.
  • Missing base: if log_b(x) = y, then b = x^(1 ÷ y).
  • The number must be greater than 0. The base must be greater than 0 and not 1.

The log rules

  • Product rule: log(A × B) = log(A) + log(B).
  • Quotient rule: log(A ÷ B) = log(A) − log(B).
  • Power rule: log(A^n) = n × log(A). A square root is the power 1/2.
  • log of the base is 1, and log of 1 is 0, in every base.
  • The rules hold when A and B are greater than 0. Write as one logarithm uses them from right to left, and Expand a logarithm from left to right.

Worked examples

Exact value. For log base 2 of 32: 2 × 2 × 2 × 2 × 2 = 32, so 2^5 = 32 and the logarithm is exactly 5. For log base 4 of 32 the answer is 5/2, because 32 × 32 = 4^5.

A number below 1. log(0.02) = −1.698970004. Its characteristic is −2 and its mantissa is 0.301030, because −2 + 0.301030 = −1.698970.

One logarithm. 2log(x) + log(y) − 3log(z) becomes log(x^2*y/z^3). With x = 2, y = 3 and z = 5, both forms give −1.017728767.

An equation. log(x) + log(x − 3) = 1 has the solution x = 5, because log(5) + log(2) = log(10) = 1. The other root of x(x − 3) = 10 is −2, which is not allowed inside a logarithm.

Discrete logarithm. 3^4 = 81 = 4 × 17 + 13, so the smallest k with 3^k ≡ 13 (mod 17) is 4.

Limits you should know

  • An answer is marked exact only when the number is an exact power of the base, with a fraction as the power and a bottom number up to 48. Every other answer is rounded to 10 significant digits.
  • Logarithms of 0 and of negative numbers are not real numbers. The page says so and gives no value. Complex logarithms are not covered.
  • Joining and expanding work on products, quotients and powers. A sum inside a logarithm, such as log(x + 1), cannot be split. A product of two logarithms cannot be joined.
  • The equation solver is a numeric search between two limits (−1,000,000 and 1,000,000 unless you change them). It gives rounded decimals, not exact forms, and it can miss a solution where the two sides only touch.
  • In typed formulas, log means base 10 and ln means base e. For another base, write log2(x), or logb(3, x) for base 3. The base comes first.
  • The discrete logarithm works for a modulus up to 10,000,000,000.
  • Table values are rounded to the number of decimal places you choose. Printed tables can differ by one in the last place.

Related tools