Log Calculator

About this calculator

The Log Calculator solves logb(x) = y. Enter any two of the base b, the number x and the answer y, leave the third blank, and it finds the missing value. Type e for the base to get natural logarithms.

Leave blank to solve for the base.
Leave blank to solve for x.
Leave blank to solve for y.
Embed this calculator

Paste this code into a Custom HTML block on your site. The calculator fits the width of the block. Adjust the height in the code if you want more room for results.

Find this widget in the publisher directory

What is a logarithm?

A logarithm answers the question "what exponent do I need?" If b raised to the power y equals x, then the logarithm of x to the base b is y. Written as an equation, logb(x) = y means exactly the same as b^y = x. Since 10^2 = 100, log10(100) = 2. Since 2^6 = 64, log2(64) = 6.

logb(x) = y  ⇔  b^y = x   (b > 0, b ≠ 1, x > 0)

Common bases

NameBaseNotationTypical use
Common log10log(x) or log10(x)Decibels, pH, Richter scale
Natural loge (about 2.71828)ln(x) or loge(x)Calculus, continuous growth
Binary log2log2(x) or lb(x)Computer science, information

Logarithm rules

  • Product: log(a × b) = log(a) + log(b). For example log(1 × 10) = 0 + 1 = 1.
  • Quotient: log(a / b) = log(a) - log(b). For example log(10 / 2) = 1 - 0.301 = 0.699.
  • Power: log(a^n) = n × log(a). For example log(2^6) = 6 × 0.301 = 1.806.
  • Base case: logb(1) = 0 and logb(b) = 1.
  • Reciprocal base: logb(a) = 1 / loga(b).

Change of base

Most calculators only have keys for log base 10 and the natural log. To find a logarithm in another base, divide two logs of the same kind: logb(x) = ln(x) / ln(b). To find log5(2), compute ln(2) / ln(5) = 0.6931 / 1.6094 = 0.4307. The identity also shows log5(2) = 1 / log2(5).

Solving for each unknown

Find y

With b and x known, compute y = ln(x) / ln(b). For b = e and x = 100, y = ln(100) = 4.6051701859881.

Find x

With b and y known, raise the base to the answer: x = b^y. For b = 2 and y = 10, x = 1,024.

Find b

With x and y known, take a root: b = x^(1/y). If logb(81) = 4, then b = 81^(1/4) = 3.

Domain restrictions

Logarithms are only defined for positive numbers. The base must also be positive and cannot be 1, because 1 raised to any power is 1. The log of zero or a negative number does not exist among the real numbers, which is why the calculator rejects them.

Where logarithms are used

Logarithms turn multiplication into addition, which is why they compress huge ranges into manageable scales. Earthquake magnitude, sound level in decibels and acidity (pH) all grow by factors of ten for each step on a log scale. They also appear in compound interest, half-life decay, algorithm analysis and the calculation of information in bits.

Frequently asked questions

What is the difference between log and ln?
log usually means base 10, while ln is the natural logarithm, base e. In some programming languages log means ln, so check the notation.
How do I calculate a log with a base other than 10 or e?
Use the change of base formula: log base b of x equals ln(x) divided by ln(b).
Why can't I take the log of zero or a negative number?
No real power of a positive base produces zero or a negative result, so the logarithm is undefined for those inputs.
What does e mean as a base?
e is Euler's number, about 2.71828. A logarithm with base e is the natural logarithm and is the inverse of the exponential function e^x.

Formulas and sample results on this page were checked against independent references. Page last reviewed or updated . How we verify calculators. Project led by Shaun Connell.