Home › Calculators › Logarithm Calculator

Logarithm Calculator

Work out log_b(x) for any base, the natural log ln(x), log₁₀ and log₂ at once, or switch to antilog mode to calculate bʸ. Every answer comes with the change-of-base working and a check.

log₂(x)–
ln x (base e)–
log₁₀ x–
log₂ x–

Change-of-base steps

    Examples

    Advertisement

    How to use the Logarithm Calculator

    1. Enter the number x you want the logarithm of. It must be positive. You can type decimals, fractions like 1/8, 2.5e-4 or e.
    2. Choose the base: e for ln, 10 for the common log, 2 for the binary log, or Custom to type any base b.
    3. Press Calculate (results also update as you type) to see log_b(x) along with ln, log₁₀ and log₂ of the same number.
    4. Read the steps to see the change-of-base formula ln(x) / ln(b) worked out.
    5. Switch to Antilog to go the other way: enter a base and a value y to get bʸ.

    Logarithm rules

    RuleFormulaExample
    Definitionlog_b(x) = y ⇔ bʸ = xlog₂ 32 = 5 because 2⁵ = 32
    Productlog_b(xy) = log_b x + log_b ylog 200 = log 2 + log 100 ≈ 0.30103 + 2
    Quotientlog_b(x/y) = log_b x − log_b yln(e³/e) = 3 − 1 = 2
    Powerlog_b(xⁿ) = n · log_b xlog₂ 8⁴ = 4 × 3 = 12
    Change of baselog_b x = ln x / ln blog₅ 100 = 4.60517 / 1.60944 ≈ 2.86135
    Log of 1log_b 1 = 0ln 1 = 0
    Log of the baselog_b b = 1log₁₀ 10 = 1
    Reciprocal baselog_b x = 1 / log_x blog₈ 2 = 1/3

    Worked example: log base 3 of 20

    1. Ask: 3 to what power gives 20? Since 3² = 9 and 3³ = 27, the answer is between 2 and 3.
    2. Change of base: log₃ 20 = ln 20 / ln 3.
    3. ln 20 ≈ 2.9957323 and ln 3 ≈ 1.0986123.
    4. 2.9957323 / 1.0986123 ≈ 2.7268330.
    5. Check: 3^2.7268330 ≈ 20.000000.

    Common logarithm values

    xlog₁₀ xln xlog₂ x
    0.5−0.30103−0.69315−1
    1000
    20.301030.693151
    e ≈ 2.718280.4342911.44270
    30.477121.098611.58496
    50.698971.609442.32193
    1012.302593.32193
    10024.605176.64386
    100036.907769.96578

    Frequently asked questions

    What is a logarithm?

    A logarithm is the power you must raise the base to in order to get the number. log₂ 8 = 3 because 2³ = 8, and log₁₀ 1000 = 3 because 10³ = 1000.

    How do I calculate a log with a different base?

    Use the change-of-base formula: log_b(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b). For example log₃ 20 = ln 20 / ln 3 = 2.995732 / 1.098612 ≈ 2.726833.

    What is the difference between log and ln?

    ln is the natural logarithm with base e ≈ 2.71828. log usually means base 10 in science and on calculators, but in computer science it often means base 2. This calculator shows all three for the same number.

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

    A positive base raised to any real power is always positive, so no real exponent gives 0 or a negative number. log(0) tends to minus infinity and logs of negative numbers are only defined with complex numbers.

    What is an antilog?

    The antilog is the inverse of a logarithm: antilog_b(y) = bʸ. For base 10, antilog(2.5) = 10^2.5 ≈ 316.2278. For the natural log, the antilog is eʸ.

    Why can't the base be 1?

    1 raised to any power is 1, so log base 1 could never give any other number. The base must be positive and different from 1.

    What is log base 2 used for?

    log₂ tells you how many times you can halve a number or how many bits are needed. log₂ 1024 = 10, so 10 bits can store 1024 different values.

    Related tools