Skip to content
Back to Calculators

Log Calculator

Calculate a logarithm, or solve for the base or the number, with exact answers and the steps

Solve for

logb(x) = y  means  by = x

A positive number other than 1, or e.

The number you take the log of. Must be positive. e is allowed.

Calculated in your browser; nothing you enter is saved or sent.

Illustrative example shown. Enter your own values and press Calculate.

Result (y)
3
exact
Equation
log₂(8) = y
Same fact, as a power
2^y = 8

The curve y = logb(x)

Graph of the logarithm curve for base 2 with the point x = 8, y = 3 marked.(8, 3)xy1

The steps

  1. log₂(8) = y asks: to what power y must the base 2 be raised to give 8?
  2. Written as an exponential equation: 2^y = 8.
  3. Change of base: y = ln(8) ÷ ln(2) = 2.07944154168 ÷ 0.69314718056 ≈ 3.
  4. Exact check: 2^3 = 8. So y = 3.

How to Calculate a Logarithm

A logarithm answers one question: what exponent turns the base into the number? Written log_b(x) = y, it means b raised to the power y equals x. So log base 2 of 8 is 3, because 2 × 2 × 2 = 8. In the same way log base 10 of 1000 is 3, and log base 3 of 81 is 4. When the answer is a whole number or a simple fraction, the calculator shows it exactly; otherwise it gives a decimal and marks it as approximate.

The result can be negative or fractional. Log base 2 of 0.125 is -3, because 2 raised to the power -3 is one eighth. The argument itself must be positive: there is no real power of a positive base that produces zero or a negative number. The base must also be positive and cannot be 1, since 1 raised to any power is still 1. The calculator checks these rules and tells you which entry to change.

To calculate a logarithm by hand, find the exponent by repeated multiplication when the numbers are friendly. For anything else, use the change-of-base rule, log_b(x) = ln(x) ÷ ln(b), which lets any scientific calculator evaluate a log in any base. The steps panel in the tool applies exactly that rule and shows the two natural logarithms.

How to Solve for the Base or Argument

The calculator can solve for any one of the three quantities in log_b(x) = y. To find the argument, raise the base to the result: x = b^y. For a base of 0.5 and a result of −3, the argument is 0.5 to the power −3, which is 8. For base 10 and result 2.5 the argument is 316.227766017, a number between 100 and 1000, as you would expect.

To find the base, take the y-th root of the argument: b = x^(1/y). With an argument of 8 and a result of 3 the base is the cube root of 8, which is 2. With an argument of 81 and a result of 4 the base is 3. Solving for the base is useful when a growth problem tells you the final multiple and the number of periods and asks for the rate or the base of the exponential.

Two special cases need care. If the argument is 1 and the result is 0, every valid base works, because any base raised to the power 0 equals 1; the calculator reports that every base is a solution instead of inventing a single answer. If the argument is 2 and the result is 0, no base works, because no base raised to 0 gives 2, and the calculator says there is no solution.

Natural Log, Common Log, and Log Base 2

Three bases appear far more often than the others. The common logarithm uses base 10 and is written log or log₁₀; it counts digits and measures things like decibels and pH. The natural logarithm uses base e, about 2.718, and is written ln; it is the inverse of e^x and appears in continuous growth, interest and probability. The binary logarithm uses base 2, written log₂, and counts how many times you can halve something, which is why it shows up in computer science and information theory.

Worked example with ln: the natural log of 20 is about 2.99573227355, because e raised to that power is 20. You can type e directly as the base or the argument. Worked example with base 2: log₂(1000) is about 9.96578428466, so you need about ten halvings to bring 1000 down to 1, and a binary number needs 10 bits to hold values up to 1000. Both are irrational numbers, so the decimal is an approximation of an endless expansion.

Rules That Make Logs Easier

Three identities do most of the work. The product rule says log_b(xy) = log_b(x) + log_b(y), so multiplication becomes addition. The quotient rule says log_b(x ÷ y) = log_b(x) − log_b(y). The power rule says log_b(x^k) = k × log_b(x), which is how exponents come down out of an equation when you are solving for them. Together they explain why logarithms were used to speed up arithmetic before electronic calculators, and why they still turn multiplicative growth into straight lines on a log chart.

Logarithms and exponents are inverses. Taking log_b of b^y returns y, and raising b to log_b(x) returns x. If you are stuck on an equation such as 5^x = 200, take the log of both sides and divide: x = ln(200) ÷ ln(5). You can check the answer by entering base 5 and argument 200 in the tool.

Frequently asked questions

What is the log of 1?

It is 0 in every valid base, because any base raised to the power 0 equals 1. That is why the calculator reports that every base works when you ask for the base with an argument of 1 and a result of 0.

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

A positive base raised to any real power always gives a positive result, so no exponent produces zero or a negative number. Complex logarithms exist, but this calculator works with real numbers only.

What is the difference between log and ln?

Log usually means base 10 and ln means base e. The two differ by a constant factor: ln(x) = log₁₀(x) × ln(10). Some texts use log for base e or base 2, so check which convention your course or software uses.

How do I calculate log base 2 on a normal calculator?

Divide the natural log of the number by the natural log of 2, or the base-10 log by the base-10 log of 2. This is the change-of-base rule, and the calculator shows it in the steps.

Can the base be a fraction or less than 1?

Yes. A base between 0 and 1, such as 0.5, gives a decreasing curve, and logs of numbers greater than 1 are negative. The base cannot be 0, negative or exactly 1.

Related tools: the scientific notation calculator handles powers of ten, and the math directory lists every math tool on the site.

Get New Free Calculators by Email

Get practical calculator walkthroughs and new tool updates by email. Occasional emails only, unsubscribe at any time.

No spam. See our privacy policy.