math calculators

Logarithm Calculator

Compute the logarithm of any positive number in any base instantly. Use it for solving exponential equations, working with decibels, pH, or Richter scale values.

About this calculator

A logarithm answers the question: 'To what power must the base be raised to produce a given number?' Formally, log_b(x) = y means b^y = x. This calculator uses the change-of-base formula to handle any base: log_b(x) = ln(x) / ln(b), where ln denotes the natural logarithm. Common special cases include base 10 (the common logarithm, written log or log₁₀) and base e ≈ 2.71828 (the natural logarithm, written ln). Logarithms are essential in science and engineering — sound intensity is measured in decibels using log₁₀, earthquake magnitude uses the Richter scale (log₁₀), pH is −log₁₀[H⁺], and compound interest and population growth involve natural logarithms. Inputs must satisfy x > 0 and b > 0 with b ≠ 1.

How to use

Find log₂(32) — the power to which 2 must be raised to equal 32. Enter Number = 32 and Base = 2. The calculator applies the change-of-base formula: log₂(32) = ln(32) / ln(2) = 3.4657… / 0.6931… = 5. The result is 5, which you can verify: 2⁵ = 32. Now try a non-integer result: log₁₀(50) = ln(50) / ln(10) ≈ 3.912 / 2.303 ≈ 1.699, meaning 10^1.699 ≈ 50.

Frequently asked questions

What is the difference between log, ln, and log base 2?

These are all logarithms but with different bases. 'log' without a specified base conventionally means log base 10 (the common logarithm), widely used in engineering and the sciences. 'ln' is the natural logarithm with base e ≈ 2.71828, fundamental in calculus, continuous growth models, and physics. Log base 2 (log₂, or the binary logarithm) appears in computer science — for example, the number of bits needed to represent n values is ⌈log₂(n)⌉. All three are interconvertible using the change-of-base formula.

Why can you not take the logarithm of zero or a negative number?

The logarithm log_b(x) asks what power of b equals x. Since any positive base b raised to any real power always produces a strictly positive result, there is no real exponent that yields zero or a negative number. Mathematically, the domain of any real logarithm function is restricted to x > 0. Attempting log(0) approaches negative infinity as a limit, while log of a negative number requires complex number theory (involving imaginary components) and is outside the scope of real-valued logarithm calculators.

How are logarithms used in real-world measurements like decibels and pH?

Logarithmic scales compress enormous ranges of values into manageable numbers. Sound intensity in decibels is calculated as dB = 10 × log₁₀(I / I₀), where I₀ is the threshold of human hearing — a 10 dB increase represents a 10× increase in intensity. The pH scale measures hydrogen ion concentration as pH = −log₁₀[H⁺], so each pH unit represents a 10-fold change in acidity. The Richter scale similarly uses log₁₀ so that a magnitude 7 earthquake releases about 31.6 times more energy than a magnitude 6. These applications show why understanding logarithms is practically useful.