CalculatorPro Tools

Logarithm Calculator

Calculate logarithms in any base, plus antilogs and powers.

What Is the Logarithm Calculator?

A logarithm answers one question: what power do you raise a base to in order to get a number. The statement log base 2 of 8 equals 3 means that 2 raised to the power of 3 is 8. That is the whole idea, and everything else is either a different base or a rearranged version of it. Every calculator only has one logarithm button, because any logarithm can be converted to any other base by dividing the natural logs, and that is exactly what this calculator does. It returns your answer in the base you asked for and, in the same pass, the common log to base 10, the natural log to base e, and the binary log to base 2, so you can compare conventions without re-entering anything. An Antilog button inverts the operation and a Solve for value button turns the pair back into a plain power.

Key Statistics

  • 2.718281828459045

    The natural logarithm base e, to fifteen decimal places. It arises wherever continuous growth is involved, because e is the limit of (1 plus 1 over n) raised to n. It is also the base of the exponential decay that governs half life and radioactive decay.

    Source: NIST Reference on Constants, Units and Uncertainty

  • log(1) = 0

    In every base, without exception. Since any number raised to the power of zero equals 1, and the search exponent must be the same for all bases, zero is the only possible answer for an input of 1. The same property makes the logarithm a natural check on any answer of 1.

    Source: Basic logarithm properties

  • Decibel

    The bel, one tenth of a decibel, is the logarithmic unit expressing a ratio between two power levels. Because the scale is logarithmic, a tenfold increase adds exactly 1. This is why decibels, pH, the Richter scale and the magnitude scale of stars all share the same mathematics.

    Source: NIST Reference on Units of Measurement

The Formula

log base b of x equals the natural log of x divided by the natural log of b, which is the change of base formula. The antilog inverts it: base b raised to the power of n. To convert a logarithm from base a to base b, multiply by the natural log of a divided by the natural log of b.

Worked Examples

To find log base 2 of 8, take ln(8) which is about 2.0794, divide by ln(2) which is about 0.6931, and the answer is exactly 3. Check it by raising 2 to the power of 3, which gives 8.

A common logarithm, base 10

  1. Find log base 10 of 1000.
  2. Take the natural log: ln(1000) is about 6.9078.
  3. Divide by ln(10), which is about 2.3026.
  4. 6.9078 divided by 2.3026 is exactly 3.

log base 10 of 1000 = 3

Converting from one base to another

  1. You know log base 10 of 500 is about 2.6990 and need it in base 2.
  2. Multiply by ln(10) divided by ln(2), which is about 3.3219.
  3. 2.6990 multiplied by 3.3219 is about 8.966.

log base 2 of 500 = 8.966

Finding an antilog

  1. You know log base 10 of x is 2.5 and want x.
  2. Raise the base to the power: x = 10 to the power of 2.5.
  3. That gives about 316.23.
  4. Check by taking log base 10 of 316.23, which returns 2.5.

x = 316.23

A negative answer

  1. Find log base 10 of 0.01.
  2. 0.01 is 10 raised to the power of minus 2.
  3. So the answer is minus 2, confirmed by ln(0.01) divided by ln(10).

log base 10 of 0.01 = -2

Real World Use Cases

Measuring scales and ratios

Decibels, pH, the Richter scale and stellar magnitude are all logarithmic because the human response is. That is why a doubling on the Richter scale roughly triples the energy released, and why a pH change of one means a tenfold change in hydrogen ion concentration.

Compound growth and decay

The time to reach a target under continuous compounding is a logarithm. Finding how many doubling periods a growth rate needs to reach a target, or how long a decaying sample takes to reach a threshold, both reduce to taking a logarithm of the ratio.

Algorithms and computer science

Runtime analysis is built on logarithms because doubling the input halves the number of steps. Binary search is O(log n), and understanding that depends entirely on being comfortable manipulating logs in different bases.

Chemistry pH and buffer calculations

pH is the negative base 10 logarithm of hydrogen ion concentration. Acid and base equilibria routinely require solving for a concentration from a pH value, which is an antilog, and solving for a pH from a concentration, which is a logarithm.

Expert Tips

  • ✓ Learn the change of base formula once and it applies to every base. There is no need to memorise separate buttons for common log, natural log and binary log, because all three are one division apart.
  • ✓ Check any answer with the fact that log of 1 is 0 in every base. If your inputs give a power that should be 1 but your answer is not 0, the arithmetic has gone wrong.
  • ✓ Results very close to a whole number usually mean the inputs were exact. Floating point will give 2.9999999999999996 where the answer is 3, so snap to the whole number when the inputs are exact.
  • ✓ Remember that negative logs are normal and correct. Any value between zero and one has a negative logarithm, because it sits below 1 and exponents of values below 1 are negative.
  • ✓ A real logarithm of a negative number does not exist. If you need one, that is a signal the problem involves complex numbers rather than that your entry is wrong.

Frequently Asked Questions

How do I calculate a logarithm? ▼

Divide the natural log of the value by the natural log of the base. For log base 2 of 8, that is ln(8) divided by ln(2), which is 2.0794 divided by 0.6931, giving exactly 3.

What is the change of base formula? ▼

log base b of x equals log base a of x divided by log base a of b, for any base a you like. Using natural logs, it becomes ln(x) divided by ln(b). This is why any logarithm can be converted to any other base without a special formula.

What is the difference between common log and natural log? ▼

Only the base. The common logarithm uses base 10 and is written log with no subscript. The natural logarithm uses base e, approximately 2.71828, and is written ln. They are the same calculation with a different base, and this calculator returns both from one input.

Why can a logarithm not be zero or negative? ▼

It can. A value of 1 gives a log of 0, and any value between 0 and 1 gives a negative log, because raising a base to a negative power produces a fraction. What cannot exist is a real log of a zero or negative value.

What is an antilog? ▼

The inverse of a logarithm. Given log base b of x equal to n, the antilog finds x by raising b to the power of n. The Antilog button on this calculator does exactly that and shows the log of the result as a check.

Why is log base 1 undefined? ▼

Because 1 raised to any power is 1, so there is no exponent that turns 1 into anything except 1. The logarithm is searching for that exponent, and no such exponent exists for any other value.

How do I solve 2 to the power of x equals 100? ▼

Take the log of both sides. x multiplied by log base 2 of 2 equals log base 2 of 100, and log base 2 of 2 is 1, so x equals log base 2 of 100, which is about 6.644. Use the Solve for value button on this calculator for the direct route.

What are logs used for in real life? ▼

Anywhere a ratio is measured on a scale that matches human perception. Decibels for sound, pH for acidity, the Richter scale for earthquakes and stellar magnitude for brightness all use logarithms, which is why each doubling on those scales has a consistent physical meaning.

Why does my calculator give 2.9999999999999996 instead of 3? ▼

Floating point representation of numbers cannot store 8 and 2 as exact fractions of their true values, so dividing their natural logs leaves a tiny remainder. The mathematical answer is 3, and this calculator snaps results that fall within a very small tolerance of a whole number so the exact case displays correctly.

How precise is a logarithm result? ▼

The precision of the answer matches the precision of the input. Doubling the number of decimal places in your input adds about one decimal place of reliability to the output, and no more. Rounding the result further than the input supports implies accuracy you do not have.

Common Mistakes to Avoid

  • ⚠ Reading log(100) as log(10) times 2 instead of the log of 100, which happens to be the same answer here by coincidence and causes confusion elsewhere.
  • ⚠ Dividing by the log of the value instead of the log of the base, which inverts the whole calculation.
  • ⚠ Forgetting that a logarithm needs a value greater than zero, then entering zero and concluding the calculator is broken.
  • ⚠ Using base 1, which is undefined because every power of 1 equals 1.
  • ⚠ Expecting the answer to be an integer when the value is not a whole power of the base.

Last updated: · by CalculatorPro Tools