Logarithm Calculator

Find the logarithm of any positive number in base 10, base e, base 2, or a custom base.

Last updated:
Calculation Details:

    Was this calculator helpful?

    ★ ★ ★ ★ ★
    Embed this calculator

    Calculation Examples

    Calculation Case Result
    log₁₀(1000) 3 (because 10³ = 1000)
    Natural log ln(e) 1 (because e¹ = e)
    log₂(64) 6 (because 2⁶ = 64)
    log₂(100) About 6.644 (between 2⁶ = 64 and 2⁷ = 128)
    Mihail Doncenco
    Mihail Doncenco Site Creator & Calculator Expert

    Founder and developer of CalcMate. Builds and maintains every calculator on this site, focusing on formula accuracy and clear, practical results.

    How to Use the Log Calculator

    Enter the argument (the number whose logarithm you want) and pick the base. Presets cover base 10 (common logarithm, written log), base \(e\) (natural logarithm, written ln), and base 2 (binary logarithm, written log₂), and you can also type any custom base.

    Click "Calculate" to get the result. Logarithms exist only for positive arguments (\(x > 0\)), and the base must satisfy \(b > 0\) and \(b \neq 1\). Invalid values return an error, not a wrong number.

    How Calculations Are Performed

    The calculator uses the change of base formula to evaluate any logarithm through the natural logarithm: \[\log_b(a) = \frac{\ln(a)}{\ln(b)}\] For base 10 this is \(\log_{10}(a) = \ln(a)/\ln(10)\), and for base 2 it is \(\log_2(a) = \ln(a)/\ln(2)\). The definition behind every result is that \(\log_b(a) = c\) means \(b^c = a\), so the logarithm answers the question "to what power must \(b\) be raised to produce \(a\)?"

    Computers work in floating point, so a ratio of logs can land a hair off an exact integer. In double precision, \(\ln(1000)/\ln(10)\) evaluates to 2.9999999999999996, not 3. Round the result to a sensible number of digits when you expect a whole number.

    Logarithm Definition: log base b of a equals c means b to the power c equals a

    Useful Tips 💡

    • Pick the "ln" or "e" preset for natural logarithms. Calculus favors them because d/dx[ln(x)] = 1/x.
    • Keep the argument above zero. As the argument approaches zero from the right, the logarithm heads toward negative infinity, and negative numbers have no real logarithm.

    📋Steps to Calculate

    1. Enter the argument value (the number you want to take the log of). It must be greater than zero.

    2. Select or enter the logarithm base. Common options are 10, e (natural log), and 2 (binary log).

    3. Click "Calculate" to receive the result and the equivalent exponential form.

    Mistakes to Avoid ⚠️

    1. Using base 1 or base 0. Every power of 1 equals 1, so no exponent can reach any other value and the logarithm is undefined. Base 0 and negative bases are also invalid.
    2. Mixing up log and ln. In most science and engineering texts, "log" means base 10, while in pure mathematics and in programming languages such as Python, JavaScript, and C, log() usually means the natural logarithm. Check the convention before you compare answers.
    3. Splitting a sum. log(x + y) does not equal log(x) + log(y). The correct identity is for products: log(x * y) = log(x) + log(y).

    Practical Applications📊

    1. Estimate algorithm steps: binary search on 1,000,000 sorted items needs at most 20 comparisons, because log₂(1,000,000) is about 19.93 and the count rounds up.

    2. Model growth and decay: the time for money to double at 6% continuous growth is ln(2) / 0.06, about 11.55 years, a result that follows from dy/dt = ky and underlies the Rule of 72.

    3. Read logarithmic scales: pH 7 means a hydrogen ion concentration of 10⁻⁷ mol/L, doubling sound power adds about 3.01 dB, and each whole step on the Richter scale means ten times the ground motion amplitude.

    Questions and Answers

    Can you calculate the logarithm of a negative number or zero?

    No, not in the real number system, because logarithms are defined only for strictly positive arguments (\(x > 0\)). A positive base raised to any real power always gives a positive result, so no real exponent produces zero or a negative number. As the argument approaches zero from the right, \(\log(x)\) tends to negative infinity. For negative arguments you need complex numbers: the principal value is \(\ln(-1) = i\pi\), from Euler's formula \(e^{i\pi} = -1\). Real-number logarithm calculators, including this one, do not return complex values.

    How do you calculate a logarithm manually using the change of base formula?

    Divide the natural log of the argument by the natural log of the base: \(\log_b(a) = \ln(a)/\ln(b) = \log_{10}(a)/\log_{10}(b)\). For example, \(\log_3(81) = \ln(81)/\ln(3) = 4.394/1.099 = 4\), which confirms \(3^4 = 81\). This is the standard way to evaluate a non-standard base, since most calculators and programming languages provide only \(\ln\) and \(\log_{10}\). Because of floating-point rounding, a computer may show 4.999999999999999 instead of 5 for \(\ln(243)/\ln(3)\), so round to the number of digits you need.

    What are the key logarithm identities and how are they applied?

    The four core identities are the product rule \(\log_b(xy) = \log_b(x) + \log_b(y)\), the quotient rule \(\log_b(x/y) = \log_b(x) - \log_b(y)\), the power rule \(\log_b(x^n) = n\log_b(x)\), and the change of base formula \(\log_b(x) = \ln(x)/\ln(b)\). They turn products into sums and powers into multipliers. For example, \(\log(x^2 y/z) = 2\log(x) + \log(y) - \log(z)\). The power rule solves exponential equations: for \(2^x = 100\), take \(\log_2\) of both sides to get \(x = \log_2(100) = \ln(100)/\ln(2) \approx 6.644\).

    What is a logarithm calculator and when is it used?

    A logarithm calculator finds the exponent that a base must be raised to in order to produce a given number, solving \(\log_b(a) = c\) for valid \(b\) and \(a\). It is useful when a quantity spans many orders of magnitude or when an exponential relationship must be inverted. Typical uses include solving for time in compound interest, finding how many binary digits a number needs, computing pH from hydrogen ion concentration, and expressing signal strength in decibels. For example, \(\log_{10}(1000) = 3\) because \(10^3 = 1000\).

    What is binary logarithm (log₂) and where is it used?

    The binary logarithm \(\log_2(x)\) is the power of 2 that gives \(x\): \(\log_2(8) = 3\) because \(2^3 = 8\). It is the basic unit of information theory, since representing \(n\) distinct values takes \(\lceil \log_2(n) \rceil\) bits. For example, 1000 values need \(\lceil 9.97 \rceil = 10\) bits. In computer science it gives the cost of binary search, \(O(\log_2 n)\) comparisons for \(n\) sorted items, and the depth of a balanced binary tree. A single-elimination tournament with 64 teams has \(\log_2(64) = 6\) rounds. In music, \(\log_2\) of a frequency ratio gives the number of octaves between two pitches.

    What is the difference between natural log (ln) and common log (log₁₀)?

    The natural log (\(\ln\)) uses \(e \approx 2.71828\) as its base, and the common log (\(\log_{10}\)) uses 10. The natural log is the standard in calculus and physics because \(d/dx[\ln(x)] = 1/x\) and \(d/dx[e^x] = e^x\), which makes it the natural fit for differential equations and continuous growth. The common log gives whole numbers for powers of 10 (\(\log_{10}(100) = 2\), \(\log_{10}(1000) = 3\)), so it suits order-of-magnitude scales such as pH, decibels, and the Richter scale. They convert as \(\ln(x) = \log_{10}(x) \times \ln(10) \approx 2.3026\,\log_{10}(x)\).

    What is the relationship between logarithms and exponential functions?

    Logarithms and exponential functions are inverse operations: \(\log_b(b^x) = x\) and \(b^{\log_b(x)} = x\) for valid \(b\) and positive \(x\). On a graph, \(y = \log_b(x)\) is the mirror image of \(y = b^x\) across the line \(y = x\). To solve \(b^x = a\), apply \(\log_b\) to both sides, which gives \(x = \log_b(a)\). For example, \(5^x = 125\) gives \(x = \log_5(125) = 3\). In calculus, \(\int (1/x)\,dx = \ln|x| + C\), which makes the natural log central to integration and to rates of change in continuous systems.

    Where do logarithms appear in real-world science and engineering?

    Logarithms appear wherever values span many orders of magnitude or an exponential process must be inverted. In acoustics, sound level is \(L = 10\log_{10}(I/I_0)\) decibels, so doubling the intensity adds \(10\log_{10}(2) \approx 3.01\) dB. In chemistry, \(\text{pH} = -\log_{10}[\text{H}^+]\), so one pH unit is a tenfold change in hydrogen ion concentration. The original Richter scale gives each whole step a tenfold increase in measured ground motion amplitude, and modern seismology reports moment magnitude, which uses a similar logarithmic scale. In information theory, entropy is \(H = -\sum p_i \log_2(p_i)\) bits. In finance, continuous growth at rate \(r\) doubles in \(t = \ln(2)/r \approx 0.693/r\), and the Rule of 72 is a practical adjustment of this figure for annual compounding.
    Disclaimer: This calculator is designed to provide helpful estimates for informational purposes. While we strive for accuracy, financial (or medical) results can vary based on local laws and individual circumstances. We recommend consulting with a professional advisor for critical decisions.