Log Calculator

Find log base b of x for any positive base, or solve the equation log_b(x) = y for x or for b. Type e as the base for the natural log.

Type e for the natural log. 10 gives the common log.

Result

log_2(50) =
5.64385619
  • Natural log, ln x3.912023005
  • Common log, log₁₀ x1.698970004
  • Binary log, log₂ x5.64385619
  • Check2^5.64385619 = 50
  • Change of base: log_2(50) = ln 50 ÷ ln 2 = 3.912023005 ÷ 0.6931471806 = 5.64385619
  • In words: 2 must be raised to the power 5.64385619 to give 50.

How to use the log calculator

Choose what you want to find:

  • The logarithm y = log_b(x). Enter the base b and the number x. You also get ln x, log₁₀ x and log₂ x, plus a check that raises the base to the answer.
  • The number x = b^y. Enter the base and the logarithm. This is the antilog.
  • The base b. Enter x and y, and the calculator solves b^y = x for b.

Type e for the natural logarithm. Decimals and E notation such as 1e-6 are accepted.

Logarithm rules

Rule Example
log_b(xy) = log_b(x) + log_b(y) log₁₀(200) = log₁₀(2) + log₁₀(100) = 0.30103 + 2
log_b(x/y) = log_b(x) − log_b(y) log₂(1/8) = 0 − 3 = −3
log_b(xⁿ) = n × log_b(x) log₃(81) = 4 × log₃(3) = 4
log_b(b) = 1 and log_b(1) = 0 ln(e) = 1
log_b(x) = ln(x) ÷ ln(b) the change-of-base formula

The change-of-base formula is how every calculator handles an unusual base. It works out the natural log of the number and of the base, then divides.

Worked example: log base 2 of 50

This is the example loaded with the page. Between which powers of 2 does 50 fall? 2⁵ = 32 and 2⁶ = 64, so the answer is between 5 and 6.

  1. Natural logs: ln 50 = 3.912023005 and ln 2 = 0.6931471806.
  2. Divide: 3.912023005 ÷ 0.6931471806 = 5.64385619.
  3. Check: 2^5.64385619 = 50.

In plain terms, you need about 5.64 doublings to grow from 1 to 50. The same idea tells you how long an investment takes to reach a target. At 7% a year, the number of years to double is log base 1.07 of 2, about 10.24 years. The compound interest calculator runs the full projection.

To go the other way, choose “The number x”. Entering base 2 and logarithm 3 gives x = 2³ = 8. To find a base, enter x = 81 and y = 4: the base is the fourth root of 81, which is 3. The exponent calculator and the root calculator work through those operations in more detail.

Where logarithms come up

  • Decibels, pH and the Richter scale are all base-10 logarithmic scales. A pH of 3 is ten times more acidic than a pH of 4.
  • Computer science uses log₂. A binary search through a million sorted items takes about log₂(1,000,000) ≈ 20 steps.
  • Growth and decay use ln. Continuous growth at rate r doubles in ln(2) ÷ r time.

Limitations

Only real logarithms are given, so x must be positive and the base positive and not 1. Answers are shown to 10 significant figures. When a result is within rounding error of a whole number and checks out exactly, such as log₁₀(1000) = 3, the whole number is shown.

Frequently asked questions

What is a logarithm?

The logarithm answers the question: what power do I raise the base to, to get this number? log₂(8) = 3 because 2³ = 8, and log₁₀(0.01) = −2 because 10^−2 = 0.01. A logarithm undoes an exponent.

What is the difference between ln and log?

ln is the natural logarithm, with base e ≈ 2.718281828. Plain log usually means base 10 on calculators and in engineering, but in many maths and programming contexts it means base e. This calculator always shows the base so there is no doubt.

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

A positive base raised to any real power is always positive. No exponent turns 2 into 0 or into −8, so those logarithms do not exist among the real numbers. As x approaches 0, log_b(x) heads to minus infinity for any base greater than 1.

Why can't the base be 1?

1 raised to any power is still 1. So log₁(5) would need a power that turns 1 into 5, and there is none, while log₁(1) would fit every power. The base must be positive and not equal to 1.

Last reviewed: